46
46
import org .LYG .GUI .nodeView .cacuString ;
47
47
import org .LYG .GUI .nodeView .nodeShow ;
48
48
import org .LYG .GUI .platForm .unicornJSplitPane ;
49
- public class GUIsample3 extends JApplet implements MouseMotionListener , MouseListener ,ItemListener ,ActionListener ,Runnable {
49
+ public class GUIsample3 extends JApplet implements MouseMotionListener , MouseListener
50
+ , ItemListener , ActionListener , Runnable {
50
51
private static final long serialVersionUID = 5270675501794340912L ;
51
52
public GUIsample3 () {
52
53
//getContentPane().setBackground(new Color(218,112,214));
53
54
getContentPane ().setBackground (new Color (255 ,255 ,255 ));
54
55
}
55
- public int w ,h ;
56
- int flash = 0 ;
57
- int count = 0 ;
56
+ public int w , h ;
57
+ int flash = 0 ;
58
+ int count = 0 ;
58
59
String currentNodeName ;
59
60
int currentNodeID ;
60
61
LinkList thislist ;
61
62
LinkNode first ;
62
- int currentx ,currenty ;
63
- int choose = 0 ;
64
- int oldx ,oldy ;
65
- int newx ,newy ;
63
+ int currentx , currenty ;
64
+ int choose = 0 ;
65
+ int oldx , oldy ;
66
+ int newx , newy ;
66
67
int isOperation = 0 ;
67
68
String treeNodeName ;
68
69
nodeShow nodeview ;
@@ -76,19 +77,19 @@ public GUIsample3() {
76
77
JScrollPane rightdownscrollPane ;
77
78
JScrollPane rightrightscrollPane ;
78
79
thisCanvas canvas ;
79
- PopupMenu popupMenu1 ,nodeMenu ,itemMenu ;
80
+ PopupMenu popupMenu1 , nodeMenu , itemMenu ;
80
81
MenuItem menuItem1 ;
81
- MenuItem configre ,run ,show ,dnode ,dline ;
82
- Thread thread ,thread1 ;
82
+ MenuItem configre , run , show , dnode , dline ;
83
+ Thread thread , thread1 ;
83
84
public void run () {
84
85
try {
85
86
Thread .sleep (100 );
86
87
} catch (InterruptedException e1 ) {
87
88
e1 .printStackTrace ();
88
89
}
89
- nodeproject .setBounds (0 , 0 ,leftsplitPane .getWidth (),leftsplitPane .getDividerLocation ());
90
+ nodeproject .setBounds (0 , 0 , leftsplitPane .getWidth (), leftsplitPane .getDividerLocation ());
90
91
nodeproject .jPanel .newimg = nodeproject .img .getScaledInstance (nodeproject .getWidth ()
91
- ,nodeproject .getHeight (),java .awt .Image .SCALE_SMOOTH );
92
+ , nodeproject .getHeight (), java .awt .Image .SCALE_SMOOTH );
92
93
nodeproject .jPanel .update (getGraphics ());
93
94
nodeproject .validate ();
94
95
while (true ){
@@ -105,6 +106,7 @@ public void start(){
105
106
thread .start ();
106
107
}
107
108
}
109
+
108
110
public void stop () {
109
111
}
110
112
@@ -122,6 +124,7 @@ public void propertyChange(java.beans.PropertyChangeEvent evt) {
122
124
}
123
125
}
124
126
});
127
+
125
128
mainsplitPane .addPropertyChangeListener (new java .beans .PropertyChangeListener () {
126
129
public void propertyChange (java .beans .PropertyChangeEvent evt ) {
127
130
if (evt .getPropertyName ().equals (JSplitPane .DIVIDER_LOCATION_PROPERTY )) {
@@ -134,6 +137,7 @@ public void propertyChange(java.beans.PropertyChangeEvent evt) {
134
137
}
135
138
}
136
139
});
140
+
137
141
righttopscrollPane .addComponentListener (new ComponentListener (){
138
142
public void componentHidden (ComponentEvent arg0 ) {}
139
143
public void componentMoved (ComponentEvent arg0 ) {}
@@ -142,14 +146,11 @@ public void componentResized(ComponentEvent arg0) {
142
146
}
143
147
public void componentShown (ComponentEvent arg0 ) {}
144
148
});
149
+
145
150
getContentPane ().addComponentListener (new ComponentListener (){
146
-
147
151
public void componentHidden (ComponentEvent arg0 ) {}
148
-
149
152
public void componentMoved (ComponentEvent arg0 ) {}
150
-
151
153
public void componentResized (ComponentEvent arg0 ) {
152
- // TODO Auto-generated method stub
153
154
w =getContentPane ().getWidth ();
154
155
h =getContentPane ().getHeight ();
155
156
mainsplitPane .setBounds (10 , 50 , w -20 , h -80 );
@@ -165,7 +166,7 @@ public void componentResized(ComponentEvent arg0) {
165
166
nodeproject .validate ();
166
167
167
168
mainsplitPane .validate ();
168
- System .out .println (w + "<>" + h );
169
+ System .out .println (w + "<>" + h );
169
170
}
170
171
171
172
public void componentShown (ComponentEvent arg0 ) {
@@ -224,17 +225,17 @@ public void actionPerformed(ActionEvent e) {
224
225
node .thisface .thispanel .setSize (300 , 300 );//setBounds(0, 0, node.x+300,node.y+200);
225
226
node .thisface .thispanel .setResizable (true );
226
227
node .thisface .thispanel .setClosable (true );
227
- node .thisface .thispanel .jsp .setBounds (0 , 0 , node .thisface .thispanel .getWidth ()- 10
228
- , node .thisface .thispanel .getHeight ()- 45 );
228
+ node .thisface .thispanel .jsp .setBounds (0 , 0 , node .thisface .thispanel .getWidth () - 10
229
+ , node .thisface .thispanel .getHeight () - 45 );
229
230
node .thisface .thispanel .jp .setPreferredSize (new Dimension (800 ,600 ));
230
231
canvas .add (node .thisface .thispanel );
231
232
node .thisface .thispanel .setVisible (true );
232
233
node .thisface .thispanel .validate ();
233
234
new OSGI_chansfer (node ,first );
234
235
}
235
236
while (node .next != null ){
236
- node = node .next ;
237
- if (node .name .equals (currentNodeName )&&node .ID == currentNodeID ){
237
+ node = node .next ;
238
+ if (node .name .equals (currentNodeName )&&node .ID == currentNodeID ){
238
239
try {
239
240
node .thisface .config ();
240
241
} catch (IOException e1 ) {
@@ -273,9 +274,8 @@ public void actionPerformed(ActionEvent e) {
273
274
} catch (InterruptedException e3 ) {
274
275
e3 .printStackTrace ();
275
276
}
276
-
277
277
}
278
- while (node .next != null ){
278
+ while (null != node .next ){
279
279
node =node .next ;
280
280
if (node .name .equals (currentNodeName )&&node .ID ==currentNodeID ){
281
281
try {
@@ -441,39 +441,39 @@ public void mouseEntered(MouseEvent arg0) {}
441
441
public void mouseExited (MouseEvent arg0 ) {}
442
442
443
443
public void mousePressed (MouseEvent arg0 ) {
444
- isOperation = 1 ;
445
- // System.out.println(arg0.getX()+"|"+arg0.getY());
444
+ isOperation = 1 ;
445
+ System .out .println (arg0 .getX ()+"|" +arg0 .getY ());
446
446
oldx = arg0 .getX ();
447
447
oldy = arg0 .getY ();
448
- currentx = arg0 .getX ();
449
- currenty = arg0 .getY ();
450
- currentNodeName = new ChooseCheck ().chooseCheckname (first ,arg0 );
451
- currentNodeID = new ChooseCheck ().chooseCheckid (first ,arg0 );
448
+ currentx = arg0 .getX ();
449
+ currenty = arg0 .getY ();
450
+ currentNodeName = new ChooseCheck ().chooseCheckname (first ,arg0 );
451
+ currentNodeID = new ChooseCheck ().chooseCheckid (first ,arg0 );
452
452
}
453
453
454
454
455
455
public void mouseReleased (MouseEvent arg0 ){
456
- isOperation = 0 ;
457
- currentx = arg0 .getX ();
458
- currenty = arg0 .getY ();
459
- first = new Sort ().sort (first );
460
- LinkNode node = new LinkNode ();
461
- node = first ;
462
- if (node != null ){
463
- if (node .rightchoose && !node .leftchoose ){
464
- if (oldx == arg0 .getX () && oldy == arg0 .getY ()){
456
+ isOperation = 0 ;
457
+ currentx = arg0 .getX ();
458
+ currenty = arg0 .getY ();
459
+ first = new Sort ().sort (first );
460
+ LinkNode node = new LinkNode ();
461
+ node = first ;
462
+ if (node != null ){
463
+ if (node .rightchoose && !node .leftchoose ){
464
+ if (oldx == arg0 .getX ()&& oldy == arg0 .getY ()){
465
465
nodeMenu .show (this , arg0 .getX (), arg0 .getY ());
466
466
}
467
467
else {
468
468
new CheckRange (first ,node ,arg0 );
469
469
}
470
470
}
471
471
node .setchoose (false );
472
- node .rightchoose = false ;
473
- while (node .next != null ){
474
- node = node .next ;
475
- if (node .rightchoose && !node .leftchoose ){
476
- if (oldx == arg0 .getX ()&&oldy ==arg0 .getY ()){
472
+ node .rightchoose = false ;
473
+ while (node .next != null ){
474
+ node = node .next ;
475
+ if (node .rightchoose && !node .leftchoose ){
476
+ if (oldx == arg0 .getX ()&&oldy ==arg0 .getY ()){
477
477
nodeMenu .show (this , arg0 .getX (), arg0 .getY ());
478
478
}
479
479
else {
@@ -674,7 +674,7 @@ public void init(){
674
674
this .resize (w ,h );
675
675
}
676
676
private void CreatMap () throws IOException {
677
- w =1420 ;
677
+ w =1400 ;
678
678
h =800 ;
679
679
getContentPane ().setLayout (null );
680
680
UIManager .put ("SplitPaneUI" ,"org.LYG.GUI.platForm.unicornSplitPaneUI" );
0 commit comments