コード例 #1
0
 public void setSize(int width, int height) {
   if (myViewBounds != null) {
     myViewBounds.setSize(width, height);
   } else {
     setBounds(null, new Dimension(width, height));
   }
 }
コード例 #2
0
  /**
   * Put the properties of this component that shall be persisted at application exit to the
   * application {@link Config}
   */
  private void saveSettings() {
    GUI gUI = configuration.getgUI();

    Rectangle sizeAndLocation = gUI.getImageConflictViewer().getSizeAndLocation();

    sizeAndLocation.setLocation(this.getLocationOnScreen().x, this.getLocationOnScreen().y);
    sizeAndLocation.setSize(this.getSize().width, this.getSize().height);
  }
コード例 #3
0
 private static Rectangle fitToScreen(
     @NotNull Dimension newDim, @NotNull RelativePoint popupPosition, JTable table) {
   Rectangle rectangle = new Rectangle(popupPosition.getScreenPoint(), newDim);
   ScreenUtil.fitToScreen(rectangle);
   if (rectangle.getHeight() != newDim.getHeight()) {
     int newHeight = (int) rectangle.getHeight();
     int roundedHeight = newHeight - newHeight % table.getRowHeight();
     rectangle.setSize((int) rectangle.getWidth(), Math.max(roundedHeight, table.getRowHeight()));
   }
   return rectangle;
 }