예제 #1
0
  private void resetListeners() {
    this.m = super.getMouseListeners();
    this.mm = super.getMouseMotionListeners();
    this.mw = super.getMouseWheelListeners();
    this.k = super.getKeyListeners();

    listeners = new ArrayList<EventListener>();

    for (MouseListener l : this.m) {
      super.removeMouseListener(l);
      listeners.add(l);
    }
    for (MouseMotionListener m : this.mm) {
      super.removeMouseMotionListener(m);
      listeners.add(m);
    }
    for (MouseWheelListener mw : this.mw) {
      super.removeMouseWheelListener(mw);
      listeners.add(mw);
    }
    for (KeyListener k : this.k) {
      super.removeKeyListener(k);
      listeners.add(k);
    }
  }
예제 #2
0
  @Override
  public void repaint() {
    if (enabled) {
      super.repaint();

      if (controller != null) controller.repaintParent();
    }
  }
예제 #3
0
 @Override
 public void render(Graphics2D g, JXMapViewer map) {
   if (isSelected()) g.setColor(selectedColor);
   else g.setColor(color);
   g.setFont(new Font("font", Font.BOLD, 12));
   Point2D p = map.getTileFactory().geoToPixel(pos.getPoint(), map.getZoom());
   g.translate(
       (int) p.getX() - shapes[0].getBounds().width / 2,
       (int) p.getY() - shapes[0].getBounds().height / 2);
   for (int i = 0; i < shapes.length; i++) {
     g.draw(shapes[i]);
     if (desc == null) g.fill(shapes[i]);
   }
   if (desc != null) g.drawString(desc, 5, 20);
   g.translate(
       -(int) p.getX() + shapes[0].getBounds().width / 2,
       -(int) p.getY() + shapes[0].getBounds().height / 2);
 }
예제 #4
0
 @Override
 public void paint(Graphics g) {
   if (enabled) super.paint(g);
 }