/*
  * (non-Javadoc)
  *
  * @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent)
  */
 public void componentMoved(ComponentEvent e) {
   ComponentPosition compPos = this.owner.getComponentPositionAdapter();
   if (compPos.hasWindow()) {
     compPos.setWindowPosition(
         (int) e.getComponent().getLocation().getX(), (int) e.getComponent().getLocation().getY());
   }
 }
 public void eventDispatched(AWTEvent evt) {
   try {
     // p("evt = " + evt);
     ComponentEvent ce = (ComponentEvent) evt;
     // p("storing component: " + ce.getComponent().getName());
     this.put(ce.getComponent().getName(), ce.getComponent());
   } catch (Exception ex) {
     // p("ex: " + ex);
   }
 }
 @Override
 public void componentResized(ComponentEvent e) {
   if (owner != null) {
     ComponentPosition compPos = owner.getComponentPositionAdapter();
     if (compPos.hasWindow()
         && e.getComponent().getSize().getWidth() > 10
         && e.getComponent().getSize().getHeight() > 10) {
       compPos.setWindowSize(
           (int) e.getComponent().getSize().getWidth(),
           (int) e.getComponent().getSize().getHeight());
     }
   }
 }
        public void componentResized(ComponentEvent e) {

          if (e.getID() != ComponentEvent.COMPONENT_RESIZED) return;

          EntryPanel panel = (EntryPanel) e.getSource();
          Dimension sz = panel.getSize();
          int w =
              (int)
                  ((sz.width - 5 * View.SPACING)
                      / (Model.getPlaces() + ((Model.getPlaces() + 1) / 2) / 2.0));
          int h = sz.height;
          panel.codepanel.setSize(Math.min(w, h));
          panel.markpanel.setSize(Math.min(w, h));
        }
 @Override
 protected final void processComponentEvent(final ComponentEvent e) {
   super.processComponentEvent(e);
   if (ComponentEvent.COMPONENT_RESIZED == e.getID()) {
     fireResized();
   }
 }
        /** @see java.awt.event.ComponentAdapter#componentMoved(java.awt.event.ComponentEvent) */
        public void componentMoved(ComponentEvent evt) {
          Rectangle bounds = evt.getComponent().getBounds();

          if (bounds.getSize().equals(m_oldBounds.getSize())) {
            m_oldBounds = bounds;
          }
        }
        /** @see java.awt.event.ComponentAdapter#componentResized(java.awt.event.ComponentEvent) */
        public void componentResized(ComponentEvent evt) {
          /* 获取目标组件 */
          Component component = evt.getComponent();

          /* 获取目标组件设置的边界和最小最大尺寸 */
          Rectangle bounds = component.getBounds();
          Dimension minSize = component.getMinimumSize();
          Dimension maxSize = component.getMaximumSize();

          /* 确定目标组件新的x轴坐标及宽度 */
          if (bounds.width < minSize.width) {
            bounds.x -= (bounds.x == m_oldBounds.x ? 0 : minSize.width - bounds.width);
            bounds.width = minSize.width;

          } else if (bounds.width > maxSize.width) {
            bounds.x += (bounds.x == m_oldBounds.x ? 0 : bounds.width - maxSize.width);
            bounds.width = maxSize.width;
          }

          /* 确定目标组件新的y轴坐标及高度 */
          if (bounds.height < minSize.height) {
            bounds.y -= (bounds.y == m_oldBounds.y ? 0 : minSize.height - bounds.height);
            bounds.height = minSize.height;

          } else if (bounds.height > maxSize.height) {
            bounds.y += (bounds.y == m_oldBounds.y ? 0 : bounds.height - maxSize.height);
            bounds.height = maxSize.height;
          }

          /* 设置目标组件的新边界 */
          component.setBounds(bounds);

          /* 保存新的边界 */
          m_oldBounds = bounds;
        }
 protected void trainIconMoved(java.awt.event.ComponentEvent ae) {
   if (ae.getSource() == _tIon) {
     log.debug("train icon X: {} Y: {}", _tIon.getLocation().x, _tIon.getLocation().y);
     spinTrainIconX.setValue(_tIon.getLocation().x);
     spinTrainIconY.setValue(_tIon.getLocation().y);
   }
 }
 public void componentMoved(ComponentEvent evt) {
   Component component = evt.getComponent();
   Point point = component.getLocation();
   if (point.y < 0) {
     component.setBounds(point.x, 0, component.getWidth(), component.getHeight());
   }
 }
  @Override
  public void componentResized(ComponentEvent event) {
    Component comp = event.getComponent();

    //        if (!(comp instanceof JScrollPane))
    //            updateVisibleSections(comp);
  }
Exemple #11
0
 public void componentResized(ComponentEvent e) {
   if (e.getSource() == this) {
     //	WIDTH = getWidth();
     //	HEIGHT = getHeight();
     //	cp.updateSize();
     //	System.out.println("updated!");
   }
 }
 @Override
 public void componentResized(ComponentEvent e) {
   Component c = e.getComponent();
   if (c.getWidth() != widthSetting.getValue() || c.getHeight() != heightSetting.getValue()) {
     widthSetting.setValue(c.getWidth());
     heightSetting.setValue(c.getHeight());
   }
 }
Exemple #13
0
 @Override
 public void componentShown(ComponentEvent e) {
   if (DEBUG) {
     System.err.println(e);
   }
   if (e.getSource() == canvas) {
     canvas.sendEventToBehaviorScheduler(e);
   }
   canvas.evaluateVisiblilty();
 }
 @Override
 public void componentResized(ComponentEvent e) {
   int increment = ThemeSettings.FONT_SIZE_INCREMENT.getValue();
   Component c = e.getComponent();
   if (c.getWidth() != getWidthForFontIncrement(widthSetting, c, increment)
       || c.getHeight() != getHeightForFontIncrement(heightSetting, c, increment)) {
     widthSetting.setValue(c.getWidth());
     heightSetting.setValue(c.getHeight());
   }
 }
 private void setEvent(java.awt.event.ComponentEvent e) {
   try {
     if (e.getSource().equals(this.getOwner())) {
       this.componentEvent = e;
       new mit.awt.event.ComponentEvent(this.getOwner()).raise();
     }
   } catch (Exception ex) {
     ex.printStackTrace();
   }
 }
Exemple #16
0
 @Override
 public void componentResized(ComponentEvent e) {
   if ((frame.getExtendedState() & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH) return;
   if ((frame.getExtendedState() & Frame.ICONIFIED) == Frame.ICONIFIED) return;
   Component c = e.getComponent();
   if (c.getHeight() != this.h || c.getWidth() != this.w) {
     this.h = c.getHeight();
     this.w = c.getWidth();
     //    			System.out.println(e.toString());
   }
 }
Exemple #17
0
 @Override
 public void componentMoved(ComponentEvent e) {
   if ((frame.getExtendedState() & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH) return;
   if ((frame.getExtendedState() & Frame.ICONIFIED) == Frame.ICONIFIED) return;
   Component c = e.getComponent();
   if (c.getX() != this.x || c.getY() != this.y) {
     this.x = c.getX();
     this.y = c.getY();
     //    			System.out.println(e.toString());
   }
 }
    public void componentResized(ComponentEvent e) {
      Component c = e.getComponent();
      if (c == mainFrame) {
        JFrame theMainFrame = (JFrame) c;
        // update the range of samples to visualize
        //
        //
        //
        //				int newSampleCount = (int)Math.round((theMainFrame.getWidth() - frameWidth) *
        // samplePerPixel / 2);
        //
        //				Selection currSel = zoomStack.get(zoomStack.size() - 1);
        //				int newLeftSamples = Math.min(currSel.beginSelInSamples, newSampleCount);
        //				int leftRemainder = newSampleCount - newLeftSamples;
        //				int newRightSamples = Math.min(myHelper.getLengthInFrames() - currSel.endSelInSamples
        // +1 , newSampleCount);
        //				int rightRemainder = newSampleCount - newRightSamples;
        //				currSel.beginSelInSamples -= newLeftSamples;
        //				currSel.endSelInSamples += newRightSamples;
        //
        //
        //				if (leftRemainder > 0  && rightRemainder == 0) {
        //					newRightSamples = Math.min(myHelper.getLengthInFrames() - currSel.endSelInSamples +
        // 1, leftRemainder);
        //					currSel.endSelInSamples += newRightSamples;
        //				} else if (leftRemainder == 0 && rightRemainder > 0) {
        //					newLeftSamples = Math.min(currSel.beginSelInSamples, rightRemainder);
        //					currSel.beginSelInSamples -= newLeftSamples;
        //				}
        //
        //				System.err.println(currSel.beginSelInSamples + " " + currSel.endSelInSamples);
        //				selBeginSample = currSel.beginSelInSamples;
        //				selEndSample = currSel.endSelInSamples;

        // update the visualization area
        frameHeight = theMainFrame.getHeight();
        frameWidth = theMainFrame.getWidth();
        // his.overViewHeight = frameHeight / 10;
        waveHeight = frameHeight - overViewHeight - controlHeight;
        controlLocY = waveHeight + overViewHeight;
        zoomThresh = frameWidth / 20;
        stemThresh = frameWidth / 8;
        wavePanel.setSize(frameWidth, waveHeight);
        controlPanel.setBounds(0, controlLocY, frameWidth, controlHeight);
        overViewPanel.setSize(frameWidth, overViewHeight);
        wavePanel.refresh(
            false); // just refresh the view. wait till user calls refresh explicitly to update data
        overViewPanel.refresh();

        // samplePerPixel = (selEndSample - selBeginSample + 1) /frameWidth;

        mainFrame.validate();
      }
    }
  private void targetPanelComponentMoved(
      java.awt.event.ComponentEvent evt) { // GEN-FIRST:event_targetPanelComponentMoved

    DndSource dndSource = null;
    for (DndSource ds : dragSources)
      if (ds.getComponent() == evt.getComponent()) {
        dndSource = ds;
        break;
      }

    if (dndSource != null) dragSources.remove(dndSource);
  } // GEN-LAST:event_targetPanelComponentMoved
Exemple #20
0
  @Override
  public void componentMoved(ComponentEvent e) {
    if (e.getSource() == canvas) {
      if (DEBUG) {
        System.err.println(e);
      }
      canvas.sendEventToBehaviorScheduler(e);

      // Issue 458 - the following is not needed for a move
      //            if (VirtualUniverse.mc.isD3D()) {
      //                canvas.notifyD3DPeer(Canvas3D.RESIZE);
      //            }
      //            canvas.evaluateVisiblilty(true);
    }
  }
 @Override
 public void componentResized(ComponentEvent e) {
   constellationPanel.setBounds(0, 0, e.getComponent().getWidth(), e.getComponent().getHeight());
 }
 /** Invoked when component has been hidden. */
 public void componentHidden(ComponentEvent e) {
   if (DEBUG) System.out.println("Component Event: " + e.toString());
 }
Exemple #23
0
 @Override
 public void componentResized(ComponentEvent ce) {
   game.resize(ce.getComponent().getWidth(), ce.getComponent().getHeight());
 }
Exemple #24
0
 public void componentResized(ComponentEvent e) {
   Component c = e.getComponent();
   setBounds(0, 0, c.getWidth(), c.getHeight());
 }
Exemple #25
0
 @Override
 public void componentResized(ComponentEvent e) {
   if (e.getComponent() != null) {
     saveWindowSize(e.getComponent().getSize());
   }
 }
Exemple #26
0
    /** Size has changed. */
    public void componentResized(ComponentEvent evt) {
      logger.log(Level.FINER, "evt = {0}", evt);

      sizeMayHaveChanged(evt.getComponent());
    } // end of componentResized
Exemple #27
0
 @Override
 public void componentMoved(ComponentEvent e) {
   if (e.getComponent() != null) {
     saveWindowLocation(e.getComponent().getLocation());
   }
 }
Exemple #28
0
 public void componentResized(ComponentEvent e) {
   System.out.println(e.getComponent().getClass().getName() + " --- Resized ");
 }
 public void componentHidden(ComponentEvent e) {
   Window w = (Window) e.getComponent();
   w.dispose();
 }
 /** @see java.awt.event.ComponentAdapter#componentHidden(java.awt.event.ComponentEvent) */
 public void componentHidden(ComponentEvent evt) {
   m_oldBounds = evt.getComponent().getBounds();
 }