Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 101820
Collapse All | Expand All

(-)drawboard-1.52-old/source/Board.java (-1 / +14 lines)
Lines 130-135 Link Here
130
    int color=current_color();
130
    int color=current_color();
131
    for (int i=0; i<parent.matrix.length; i++)parent.matrix[i]=color;
131
    for (int i=0; i<parent.matrix.length; i++)parent.matrix[i]=color;
132
    send(new Reset(current_color()));
132
    send(new Reset(current_color()));
133
    parent.repaint();
133
  }
134
  }
134
135
135
  public void focusLost(FocusEvent e){}
136
  public void focusLost(FocusEvent e){}
Lines 185-190 Link Here
185
          }
186
          }
186
187
187
        }
188
        }
189
        parent.repaint();
188
      }
190
      }
189
    }
191
    }
190
  }
192
  }
Lines 200-205 Link Here
200
      element=current_mode();
202
      element=current_mode();
201
      ((Shape)element).init((short)e.getX(),(short)e.getY(),current_color(), current_thick(),(short)e.getX(),(short)e.getY());
203
      ((Shape)element).init((short)e.getX(),(short)e.getY(),current_color(), current_thick(),(short)e.getX(),(short)e.getY());
202
      parent.requestFocus();
204
      parent.requestFocus();
205
      parent.repaint();
203
    }
206
    }
204
207
205
  }
208
  }
Lines 209-214 Link Here
209
    // texttool watches mousemove, not only mousedrag
212
    // texttool watches mousemove, not only mousedrag
210
    if (element instanceof LetterBox){
213
    if (element instanceof LetterBox){
211
      ((Shape)element).init((short)e.getX(),(short)e.getY(),current_color(), current_thick(),(short)e.getX(),(short)e.getY());
214
      ((Shape)element).init((short)e.getX(),(short)e.getY(),current_color(), current_thick(),(short)e.getX(),(short)e.getY());
215
      parent.repaint();
212
    }
216
    }
213
  }
217
  }
214
218
Lines 229-242 Link Here
229
    if (mousekey==1 && stateChanged){
233
    if (mousekey==1 && stateChanged){
230
      element=current_mode();
234
      element=current_mode();
231
      ((Shape)element).init((short)e.getX(),(short)e.getY(),current_color(), current_thick(),(short)e.getX(),(short)e.getY());
235
      ((Shape)element).init((short)e.getX(),(short)e.getY(),current_color(), current_thick(),(short)e.getX(),(short)e.getY());
236
      parent.repaint();
232
    }
237
    }
233
238
234
    if (mousekey==1 && element instanceof LetterBox){
239
    if (mousekey==1 && element instanceof LetterBox){
235
      ((Shape)element).setx2y2((short)e.getX(),(short)e.getY());
240
      ((Shape)element).setx2y2((short)e.getX(),(short)e.getY());
241
      parent.repaint();
236
    }
242
    }
237
243
238
    if (mousekey==2){
244
    if (mousekey==2){
239
      colorpicker.setNewColor(parent.matrix[e.getY()*DIM_X+e.getX()]);
245
      colorpicker.setNewColor(parent.matrix[e.getY()*DIM_X+e.getX()]);
246
      parent.repaint();
240
    }
247
    }
241
248
242
  }
249
  }
Lines 265-275 Link Here
265
        if (element != null)
272
        if (element != null)
266
          ((Shape)element).setx2y2((short)e.getX(),(short)e.getY());
273
          ((Shape)element).setx2y2((short)e.getX(),(short)e.getY());
267
      }
274
      }
275
      
276
      parent.repaint();
268
    }
277
    }
269
278
270
    if (mousekey==2)
279
    if (mousekey==2){
271
      if (e.getX()>=0 && e.getX()<DIM_X && e.getY()>=0 && e.getY()<DIM_Y)
280
      if (e.getX()>=0 && e.getX()<DIM_X && e.getY()>=0 && e.getY()<DIM_Y)
272
        colorpicker.setNewColor(parent.matrix[e.getY()*DIM_X+e.getX()]);
281
        colorpicker.setNewColor(parent.matrix[e.getY()*DIM_X+e.getX()]);
282
      
283
      parent.repaint();
284
    }
273
285
274
  }
286
  }
275
287
Lines 293-298 Link Here
293
        draw(element,parent.matrix);
305
        draw(element,parent.matrix);
294
        send(element);
306
        send(element);
295
        element=null;
307
        element=null;
308
        parent.repaint();
296
      }
309
      }
297
    }
310
    }
298
    mousekey=0;
311
    mousekey=0;
(-)drawboard-1.52-old/source/Communicator.java (-1 / +2 lines)
Lines 201-206 Link Here
201
            menu.setPeople(((Pinger)a).people);  // People counter
201
            menu.setPeople(((Pinger)a).people);  // People counter
202
202
203
        table.draw(a,parent.matrix);
203
        table.draw(a,parent.matrix);
204
        parent.repaint();
204
205
205
      }catch (IOException e){
206
      }catch (IOException e){
206
        System.out.println(Lang.get("IO Exception in second thread: ")+e);
207
        System.out.println(Lang.get("IO Exception in second thread: ")+e);
Lines 288-291 Link Here
288
  void addToQueue(Object o){
289
  void addToQueue(Object o){
289
    v.addElement(o);
290
    v.addElement(o);
290
  }
291
  }
291
}
292
}
(-)drawboard-1.52-old/source/Main.java (-21 / +4 lines)
Lines 25-31 Link Here
25
import java.util.*;
25
import java.util.*;
26
import java.io.*;
26
import java.io.*;
27
27
28
public class Main extends Applet implements Runnable{
28
public class Main extends Applet{
29
  static short RIGHT_MARGIN=100;    // Menu width
29
  static short RIGHT_MARGIN=100;    // Menu width
30
  static short BOTTOM_MARGIN=50;    // Colorpicker height
30
  static short BOTTOM_MARGIN=50;    // Colorpicker height
31
  static short DIM_X, DIM_Y;             // Window dimensions
31
  static short DIM_X, DIM_Y;             // Window dimensions
Lines 37-43 Link Here
37
  volatile Image bgImage;                       // Offline image
37
  volatile Image bgImage;                       // Offline image
38
  volatile int matrix[];                        // Offline image array
38
  volatile int matrix[];                        // Offline image array
39
  volatile int matrix2[];                       // Temporary offline image array
39
  volatile int matrix2[];                       // Temporary offline image array
40
  Thread repainter;                             // Image repaint thread
41
  boolean listenersInitialized=false;           // Initializes event listeners when images loaded
40
  boolean listenersInitialized=false;           // Initializes event listeners when images loaded
42
41
43
  Board board;            // Blackboard instance
42
  Board board;            // Blackboard instance
Lines 102-113 Link Here
102
      matrix2[i]=initBgColor;
101
      matrix2[i]=initBgColor;
103
    }
102
    }
104
103
105
    // Initialize image generator and start repainter
106
    bgSource=new MemoryImageSource((DIM_X-RIGHT_MARGIN),(DIM_Y-BOTTOM_MARGIN), ColorModel.getRGBdefault(), matrix2, 0, (DIM_X-RIGHT_MARGIN));
104
    bgSource=new MemoryImageSource((DIM_X-RIGHT_MARGIN),(DIM_Y-BOTTOM_MARGIN), ColorModel.getRGBdefault(), matrix2, 0, (DIM_X-RIGHT_MARGIN));
107
    bgImage = createImage(bgSource);
105
    bgImage = createImage(bgSource);
108
    repainter=new Thread(this);
109
    repainter.setPriority(Thread.MIN_PRIORITY);
110
    repainter.start();
111
106
112
    this.setLayout(null);
107
    this.setLayout(null);
113
108
Lines 164-169 Link Here
164
        menu.tracker.waitForAll(100);
159
        menu.tracker.waitForAll(100);
165
      }catch(InterruptedException e){}
160
      }catch(InterruptedException e){}
166
    }
161
    }
162
    
163
    repaint();
167
  }
164
  }
168
165
169
166
Lines 173-191 Link Here
173
    comm.communicatorclosing=true;
170
    comm.communicatorclosing=true;
174
  }
171
  }
175
172
176
  // =============================================================================
177
  // Subthread, repaints image
178
  public void run(){
179
    while(true){
180
      repaint();
181
      try{
182
        Thread.sleep(50);
183
      }
184
      catch (InterruptedException e){
185
        System.out.println(Lang.get("repaint thread interrupted"));
186
      }
187
    }
188
  }
189
173
190
  // =============================================================================
174
  // =============================================================================
191
  // Blackboard area repaint
175
  // Blackboard area repaint
Lines 210-217 Link Here
210
        comm.communicatorclosing=true;
194
        comm.communicatorclosing=true;
211
      }
195
      }
212
    }else{
196
    }else{
213
      g.setColor(new Color(menuBgColor));
197
      update(g);
214
      g.fillRect(0,0,DIM_X,DIM_Y);
215
    }
198
    }
216
  }
199
  }
217
200

Return to bug 101820