コード例 #1
0
 /*
  * (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());
   }
 }
コード例 #2
0
 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);
   }
 }
コード例 #3
0
 @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());
     }
   }
 }
コード例 #4
0
 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());
   }
 }
コード例 #5
0
  @Override
  public void componentResized(ComponentEvent event) {
    Component comp = event.getComponent();

    //        if (!(comp instanceof JScrollPane))
    //            updateVisibleSections(comp);
  }
コード例 #6
0
        /** @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;
        }
コード例 #7
0
        /** @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;
          }
        }
コード例 #8
0
 @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());
   }
 }
コード例 #9
0
 @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());
   }
 }
コード例 #10
0
    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();
      }
    }
コード例 #11
0
ファイル: ChartingLogger.java プロジェクト: lego-line/lejos
 @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());
   }
 }
コード例 #12
0
ファイル: ChartingLogger.java プロジェクト: lego-line/lejos
 @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());
   }
 }
コード例 #13
0
  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
コード例 #14
0
ファイル: ComponentUtils.java プロジェクト: cchantep/melasse
    /** Size has changed. */
    public void componentResized(ComponentEvent evt) {
      logger.log(Level.FINER, "evt = {0}", evt);

      sizeMayHaveChanged(evt.getComponent());
    } // end of componentResized
コード例 #15
0
ファイル: GraphVisualizer.java プロジェクト: mcgrew/bionet
 public void componentResized(ComponentEvent e) {
   Dimension newSize = ((Scalable) e.getComponent()).getScrollPane().getSize();
   newSize.width *= currentZoom;
   newSize.height *= currentZoom;
   this.setSize(newSize);
 }
コード例 #16
0
ファイル: AbstractFrame.java プロジェクト: igorhvr/zaproxy
 @Override
 public void componentResized(ComponentEvent e) {
   if (e.getComponent() != null) {
     saveWindowSize(e.getComponent().getSize());
   }
 }
コード例 #17
0
ファイル: BlockingPane.java プロジェクト: javagraphics/main
 public void componentResized(ComponentEvent e) {
   Component c = e.getComponent();
   setBounds(0, 0, c.getWidth(), c.getHeight());
 }
コード例 #18
0
ファイル: GameCanvas.java プロジェクト: vorlenko/GameEngine
 @Override
 public void componentResized(ComponentEvent ce) {
   game.resize(ce.getComponent().getWidth(), ce.getComponent().getHeight());
 }
コード例 #19
0
 @Override
 public void componentResized(ComponentEvent e) {
   constellationPanel.setBounds(0, 0, e.getComponent().getWidth(), e.getComponent().getHeight());
 }
コード例 #20
0
ファイル: MapPanelV2.java プロジェクト: Jamnic/BoTak
 public void componentResized(ComponentEvent e) {
   System.out.println(e.getComponent().getClass().getName() + " --- Resized ");
 }
コード例 #21
0
ファイル: AbstractFrame.java プロジェクト: igorhvr/zaproxy
 @Override
 public void componentMoved(ComponentEvent e) {
   if (e.getComponent() != null) {
     saveWindowLocation(e.getComponent().getLocation());
   }
 }
コード例 #22
0
 /** @see java.awt.event.ComponentAdapter#componentHidden(java.awt.event.ComponentEvent) */
 public void componentHidden(ComponentEvent evt) {
   m_oldBounds = evt.getComponent().getBounds();
 }
コード例 #23
0
 public void componentHidden(ComponentEvent e) {
   Window w = (Window) e.getComponent();
   w.dispose();
 }
コード例 #24
0
ファイル: PAppletWindow.java プロジェクト: JelteF/project_bpm
 /*
  * (non-Javadoc)
  */
 public void componentMoved(ComponentEvent e) {
   Component c = e.getComponent();
   x = c.getLocation().x;
   y = c.getLocation().y;
   updateTitle();
 }