diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/SnapToolPanel.java | |
| download | worlds.jar-main.tar.xz worlds.jar-main.zip | |
Diffstat (limited to 'NET/worlds/console/SnapToolPanel.java')
| -rw-r--r-- | NET/worlds/console/SnapToolPanel.java | 181 |
1 files changed, 181 insertions, 0 deletions
diff --git a/NET/worlds/console/SnapToolPanel.java b/NET/worlds/console/SnapToolPanel.java new file mode 100644 index 0000000..eba6b68 --- /dev/null +++ b/NET/worlds/console/SnapToolPanel.java @@ -0,0 +1,181 @@ +/* */ package NET.worlds.console; +/* */ +/* */ import java.awt.Button; +/* */ import java.awt.Checkbox; +/* */ import java.awt.Color; +/* */ import java.awt.Dimension; +/* */ import java.awt.Event; +/* */ import java.awt.Frame; +/* */ import java.awt.GridBagConstraints; +/* */ import java.awt.GridBagLayout; +/* */ import java.awt.Label; +/* */ import java.awt.Point; +/* */ import java.awt.TextField; +/* */ import java.awt.Window; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class SnapToolPanel +/* */ extends Frame +/* */ implements MainCallback, MainTerminalCallback +/* */ { +/* */ private static final long serialVersionUID = 1673536928568480266L; +/* */ private Label xLabel; +/* */ private Label yLabel; +/* */ private Label zLabel; +/* */ private TextField xValue; +/* */ private TextField yValue; +/* */ private TextField zValue; +/* */ private Checkbox useSnapBox; +/* */ private Button okButton; +/* */ private Button cancelButton; +/* */ private int snapX; +/* */ private int snapY; +/* */ private int snapZ; +/* */ private boolean useSnap; +/* */ +/* */ public SnapToolPanel(Window parent) +/* */ { +/* 47 */ super("Snap Tool Settings"); +/* */ +/* 49 */ this.okButton = new Button("Ok"); +/* 50 */ this.cancelButton = new Button("Cancel"); +/* 51 */ this.xLabel = new Label("X Snap Value"); +/* 52 */ this.yLabel = new Label("Y Snap Value"); +/* 53 */ this.zLabel = new Label("Z Snap Value"); +/* */ +/* 55 */ this.snapX = SnapTool.snapTool().getSnapX(); +/* 56 */ this.snapY = SnapTool.snapTool().getSnapY(); +/* 57 */ this.snapZ = SnapTool.snapTool().getSnapZ(); +/* 58 */ this.useSnap = SnapTool.snapTool().useSnap(); +/* */ +/* 60 */ this.useSnapBox = new Checkbox("Use Snap Tool", this.useSnap); +/* 61 */ this.xValue = new TextField(this.snapX); +/* 62 */ this.yValue = new TextField(this.snapY); +/* 63 */ this.zValue = new TextField(this.snapZ); +/* */ +/* 65 */ GridBagLayout gbag = new GridBagLayout(); +/* 66 */ GridBagConstraints c = new GridBagConstraints(); +/* 67 */ setLayout(gbag); +/* 68 */ setBackground(Color.gray); +/* */ +/* 70 */ c.gridx = 1; +/* 71 */ c.gridy = 1; +/* 72 */ c.gridheight = 1; +/* 73 */ c.gridwidth = 1; +/* 74 */ c.anchor = 18; +/* 75 */ gbag.setConstraints(this.xLabel, c); +/* 76 */ add(this.xLabel); +/* */ +/* 78 */ c.gridx = 2; +/* 79 */ c.gridy = 1; +/* 80 */ gbag.setConstraints(this.xValue, c); +/* 81 */ add(this.xValue); +/* */ +/* 83 */ c.gridx = 1; +/* 84 */ c.gridy = 2; +/* 85 */ gbag.setConstraints(this.yLabel, c); +/* 86 */ add(this.yLabel); +/* */ +/* 88 */ c.gridx = 2; +/* 89 */ c.gridy = 2; +/* 90 */ gbag.setConstraints(this.yValue, c); +/* 91 */ add(this.yValue); +/* */ +/* 93 */ c.gridx = 1; +/* 94 */ c.gridy = 3; +/* 95 */ gbag.setConstraints(this.zLabel, c); +/* 96 */ add(this.zLabel); +/* */ +/* 98 */ c.gridx = 2; +/* 99 */ c.gridy = 3; +/* 100 */ gbag.setConstraints(this.zValue, c); +/* 101 */ add(this.zValue); +/* */ +/* 103 */ c.gridx = 2; +/* 104 */ c.gridy = 5; +/* 105 */ gbag.setConstraints(this.useSnapBox, c); +/* 106 */ add(this.useSnapBox); +/* */ +/* 108 */ c.gridx = 5; +/* 109 */ c.gridy = 1; +/* 110 */ gbag.setConstraints(this.okButton, c); +/* 111 */ add(this.okButton); +/* */ +/* 113 */ c.gridx = 5; +/* 114 */ c.gridy = 2; +/* 115 */ gbag.setConstraints(this.cancelButton, c); +/* 116 */ add(this.cancelButton); +/* */ +/* */ +/* 119 */ pack(); +/* 120 */ Point loc = parent.getLocation(); +/* 121 */ Dimension size = parent.getSize(); +/* 122 */ setBounds(loc.x + (size.width - 320) / 2, +/* 123 */ loc.y + (size.height - 240) / 2, 320, 240); +/* */ +/* 125 */ setVisible(true); +/* */ +/* 127 */ Main.register(this); +/* */ } +/* */ +/* */ @Deprecated +/* */ public boolean handleEvent(Event ev) +/* */ { +/* 133 */ switch (ev.id) { +/* */ case 201: +/* 135 */ dispose(); +/* 136 */ return true; +/* */ } +/* 138 */ return super.handleEvent(ev); +/* */ } +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean action(Event e, Object o) +/* */ { +/* 145 */ if (e.target == this.cancelButton) { +/* 146 */ dispose(); +/* 147 */ return true; } +/* 148 */ if (e.target == this.okButton) { +/* 149 */ this.snapX = Integer.parseInt(this.xValue.getText()); +/* 150 */ this.snapY = Integer.parseInt(this.yValue.getText()); +/* 151 */ this.snapZ = Integer.parseInt(this.zValue.getText()); +/* 152 */ this.useSnap = this.useSnapBox.getState(); +/* */ +/* 154 */ SnapTool.snapTool().setSnap(this.useSnap); +/* 155 */ SnapTool.snapTool().setSnapX(this.snapX); +/* 156 */ SnapTool.snapTool().setSnapY(this.snapY); +/* 157 */ SnapTool.snapTool().setSnapZ(this.snapZ); +/* */ +/* 159 */ dispose(); +/* 160 */ return true; +/* */ } +/* 162 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ public void mainCallback() {} +/* */ +/* */ +/* */ +/* */ public void terminalCallback() +/* */ { +/* 173 */ Main.unregister(this); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\SnapToolPanel.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |