aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-24 16:15:00 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-24 16:15:00 +0900
commit8c45dda66cf5f37066f02c22ceb36509d0ac35c2 (patch)
tree9d0bb9f80653b39f3529790d5f9bfa2b9658f60b /src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java
parent0593c1b6390ddf7c92c6a5ddab3e31c5f6e59e7d (diff)
downloadSkyblock-Dungeons-Guide-8c45dda66cf5f37066f02c22ceb36509d0ac35c2.tar.gz
Skyblock-Dungeons-Guide-8c45dda66cf5f37066f02c22ceb36509d0ac35c2.tar.bz2
Skyblock-Dungeons-Guide-8c45dda66cf5f37066f02c22ceb36509d0ac35c2.zip
save and edit generic roomdata
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java
new file mode 100644
index 00000000..65d23bf2
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MLabelAndElement.java
@@ -0,0 +1,32 @@
+package kr.syeyoung.dungeonsguide.roomedit.elements;
+
+import kr.syeyoung.dungeonsguide.roomedit.MPanel;
+
+import java.awt.*;
+
+public class MLabelAndElement extends MPanel {
+ private MLabel label;
+ private MPanel element;
+
+ public MLabelAndElement(String label, MPanel element) {
+ this.add(this.label = new MLabel());
+ this.label.setText(label);
+ this.add(element);
+ this.element = element;
+ }
+
+ @Override
+ public void resize(int parentWidth, int parentHeight) {
+ this.setSize(new Dimension(parentWidth, bounds.height));
+ label.setBounds(new Rectangle(0,0,parentHeight / 3, bounds.height));
+ element.setBounds(new Rectangle(parentWidth / 3,0,parentWidth / 3 * 2, bounds.height));
+ }
+
+ @Override
+ public void setBounds(Rectangle bounds) {
+ super.setBounds(bounds);
+
+ label.setBounds(new Rectangle(0,0,bounds.width / 3, bounds.height));
+ element.setBounds(new Rectangle(bounds.width / 3,0,bounds.width / 3 * 2, bounds.height));
+ }
+}