@Override public void mouseReleased(MouseEvent e) { bDragged = false; if (j instanceof DialogManager) { return; } if (j != null && rec != null) { j.setBounds(rec); } oldRec = null; if (rec == null) { return; } if (rec.x < 0) { rec.x = 0; if (j != null) { j.setBounds(rec); } } if (rec.y < 0) { rec.y = 0; if (j != null) { j.setBounds(rec); } } j = null; }
super.setBounds(bounds);
@Override public void mouseDragged(MouseEvent e) { if (bDragged) { dx = e.getX() - mx; dy = e.getY() - my; rec.x += dx; rec.y += dy; mx = e.getX(); my = e.getY(); if (oldRec == null) { oldRec = new Rectangle(rec); } int i = Math.abs(oldRec.x - rec.x) + Math.abs(oldRec.y - rec.y); if (i > 3) { oldRec = new Rectangle(rec); j.setBounds(oldRec); } } }
private void addRow(String label, JComponent component) { JLabel l = new JLabel(label); l.setFont(Theme.SMALL_BOLD_FONT); l.setBounds(18, y, 400, 18); add(l); y += 18; int componentHeight = (int) component.getPreferredSize().getHeight(); component.setBounds(16, y, 400, componentHeight); y += componentHeight; y += 2; // vertical gap add(component); }
private void addRow(String label, JComponent component) { JLabel l = new JLabel(label); l.setFont(Theme.SMALL_BOLD_FONT); l.setBounds(18, y, 400, 18); add(l); y += 18; int componentHeight = (int) component.getPreferredSize().getHeight(); component.setBounds(16, y, 400, componentHeight); y += componentHeight; y += 2; // vertical gap add(component); }
public void setActualBounds(Rectangle actualBounds) { this.actualBounds = (Rectangle) actualBounds.clone(); Rectangle paintBounds = (Rectangle) actualBounds.clone(); if (hasShadow()) { paintBounds.x -= (shadowSize - shadowOffset); paintBounds.y -= (shadowSize - shadowOffset); paintBounds.width += (2 * shadowSize); paintBounds.height += (2 * shadowSize); } super.setBounds(paintBounds); updateAllFollowers(); }
/** * @see java.awt.Component#setBounds(int, int, int, int) */ public void setBounds(int x, int y, int w, int h) { m_offscreen = null; super.setBounds(x,y,w,h); }
@SuppressWarnings("deprecation") public void reshape(int x, int y, int w, int h) { if (inner != null) { inner.setBounds(0, 0, w, h); } super.reshape(x, y, w, h); }
@Override public void setBounds(int x, int y, int w, int h) { super.setBounds(x, y, w, h); updateAxisDimension(w, h); }
@Override public void setBounds(int x, int y, int w, int h) { super.setBounds(x,y,w,h); recalc(); }
public void setBounds( int x, int y, int width, int height ) { setPreferredSize( new Dimension(width, height) ); setMinimumSize( new Dimension(width, height) ); super.setBounds( x, y, width, height ); }
@Override public void setBounds(int x, int y, int width, int height) { Rules rule = edgeColor.getRule(); if(EdgeController.Rules.BY_PARENT != rule) edgeColor.resetCache(); super.setBounds(x, y, width, height); }
private void updateLocation() { JComponent[] components = getOverlayComponents(); for (JComponent c : components) { if (c == null) { return; } Rectangle r = getOverlayComponentBounds(c); c.setBounds(r); } }
private void updateLocation() { JComponent[] components = getOverlayComponents(); for (JComponent c : components) { if (c == null) { return; } if (c.isVisible()) { Rectangle r = getOverlayComponentBounds(c); c.setBounds(r); } } }
/** * Updates the bounds of the component and updates the camera accordingly. * * @param x left of bounds * @param y top of bounds * @param width width of bounds * @param height height of bounds */ public void setBounds(final int x, final int y, final int width, final int height) { camera.setBounds(camera.getX(), camera.getY(), width, height); super.setBounds(x, y, width, height); }
@Override public void setBounds (int x, int y, int width, int height) { super.setBounds (x, y, width, height); Rectangle bounds = scene.getBounds (); double zoomFactor = scene.getZoomFactor(); if (bounds != null && width == (int) (bounds.width * zoomFactor) && height == (int) (bounds.height * zoomFactor)) return; scene.revalidate (); scene.validate (); }
public void setActualBounds(Rectangle actualBounds) { this.actualBounds = (Rectangle) actualBounds.clone(); Rectangle paintBounds = (Rectangle) actualBounds.clone(); if (hasShadow()) { paintBounds.x -= (shadowSize - shadowOffset); paintBounds.y -= (shadowSize - shadowOffset); paintBounds.width += (2 * shadowSize); paintBounds.height += (2 * shadowSize); } super.setBounds(paintBounds); updateAllFollowers(); }
private final void installInner(JComponent c) { synchronized (getTreeLock()) { if (inner != null) { remove(inner); } inner = c; if (inner != null) { c.setBounds(0, 0, getWidth(), getHeight()); add(c); } } }
public void layoutContainer(final Container c) { final NodeView view = (NodeView) c; JComponent content = view.getContent(); if(content == null) return; content.setVisible(view.isContentVisible()); final int x = view.getSpaceAround(); final int y = x; final Dimension contentProfSize = ContentSizeCalculator.INSTANCE.calculateContentSize(view); content.setBounds(x, y, contentProfSize.width, contentProfSize.height); placeChildren(view); }
protected void paintComponent(Graphics g) { JTableHeader header = getHeader(); setupHeader(header); TableCellRenderer renderer = header.getDefaultRenderer(); JComponent component = (JComponent)renderer.getTableCellRendererComponent( getTable(), "", isSelected && isPressed, isFocusOwner(), -1, 0); // NOI18N int height = header.getPreferredSize().height; component.setBounds(0, 0, getWidth(), height); component.setOpaque(false); getPainter().paintComponent(g, component, null, 0, 0, getWidth(), height, false); }