/*
  * (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 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);
  }
        /** @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;
        }
        /** @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;
          }
        }
 @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());
   }
 }
 @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());
   }
 }
    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();
      }
    }
Beispiel #11
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());
   }
 }
Beispiel #12
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());
   }
 }
  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
Beispiel #14
0
    /** Size has changed. */
    public void componentResized(ComponentEvent evt) {
      logger.log(Level.FINER, "evt = {0}", evt);

      sizeMayHaveChanged(evt.getComponent());
    } // end of componentResized
Beispiel #15
0
 public void componentResized(ComponentEvent e) {
   Dimension newSize = ((Scalable) e.getComponent()).getScrollPane().getSize();
   newSize.width *= currentZoom;
   newSize.height *= currentZoom;
   this.setSize(newSize);
 }
Beispiel #16
0
 @Override
 public void componentResized(ComponentEvent e) {
   if (e.getComponent() != null) {
     saveWindowSize(e.getComponent().getSize());
   }
 }
Beispiel #17
0
 public void componentResized(ComponentEvent e) {
   Component c = e.getComponent();
   setBounds(0, 0, c.getWidth(), c.getHeight());
 }
Beispiel #18
0
 @Override
 public void componentResized(ComponentEvent ce) {
   game.resize(ce.getComponent().getWidth(), ce.getComponent().getHeight());
 }
 @Override
 public void componentResized(ComponentEvent e) {
   constellationPanel.setBounds(0, 0, e.getComponent().getWidth(), e.getComponent().getHeight());
 }
Beispiel #20
0
 public void componentResized(ComponentEvent e) {
   System.out.println(e.getComponent().getClass().getName() + " --- Resized ");
 }
Beispiel #21
0
 @Override
 public void componentMoved(ComponentEvent e) {
   if (e.getComponent() != null) {
     saveWindowLocation(e.getComponent().getLocation());
   }
 }
 /** @see java.awt.event.ComponentAdapter#componentHidden(java.awt.event.ComponentEvent) */
 public void componentHidden(ComponentEvent evt) {
   m_oldBounds = evt.getComponent().getBounds();
 }
 public void componentHidden(ComponentEvent e) {
   Window w = (Window) e.getComponent();
   w.dispose();
 }
Beispiel #24
0
 /*
  * (non-Javadoc)
  */
 public void componentMoved(ComponentEvent e) {
   Component c = e.getComponent();
   x = c.getLocation().x;
   y = c.getLocation().y;
   updateTitle();
 }