/** * Returns an array of all of the selected indices, in increasing * order. * * @return all of the selected indices, in increasing order, * or an empty array if nothing is selected * @see #removeSelectionInterval * @see #addListSelectionListener */ @Transient public int[] getSelectedIndices() { ListSelectionModel sm = getSelectionModel(); int iMin = sm.getMinSelectionIndex(); int iMax = sm.getMaxSelectionIndex(); if ((iMin < 0) || (iMax < 0)) { return new int[0]; } int[] rvTmp = new int[1+ (iMax - iMin)]; int n = 0; for(int i = iMin; i <= iMax; i++) { if (sm.isSelectedIndex(i)) { rvTmp[n++] = i; } } int[] rv = new int[n]; System.arraycopy(rvTmp, 0, rv, 0, n); return rv; }
@Transient public byte[] assetBytes(){ ByteBuffer buffer = ByteBuffer.allocate(MAX_BUFFER_SIZE) .order(ByteOrder.LITTLE_ENDIAN); addBytes(buffer); buffer.flip(); byte[] result = new byte[buffer.remaining()]; buffer.get(result); return result; }
/** * Returns the current x,y position within the child which is displayed * at the 0,0 location of the scrolled panel's view port. * This is a convenience method which interfaces with the adjustable * objects which represent the state of the scrollbars. * @return the coordinate position for the current scroll position * @throws NullPointerException if the scrollpane does not contain * a child */ @Transient public Point getScrollPosition() { synchronized (getTreeLock()) { if (getComponentCount()==0) { throw new NullPointerException("child is null"); } return new Point(hAdjustable.getValue(), vAdjustable.getValue()); } }
/** * If the maximum size has been set to a non-<code>null</code> value * just returns it. If the UI delegate's <code>getMaximumSize</code> * method returns a non-<code>null</code> value then return that; * otherwise defer to the component's layout manager. * * @return the value of the <code>maximumSize</code> property * @see #setMaximumSize * @see ComponentUI */ @Transient public Dimension getMaximumSize() { if (isMaximumSizeSet()) { return super.getMaximumSize(); } Dimension size = null; if (ui != null) { size = ui.getMaximumSize(this); } return (size != null) ? size : super.getMaximumSize(); }
/** * If the minimum size has been set to a non-<code>null</code> value * just returns it. If the UI delegate's <code>getMinimumSize</code> * method returns a non-<code>null</code> value then return that; otherwise * defer to the component's layout manager. * * @return the value of the <code>minimumSize</code> property * @see #setMinimumSize * @see ComponentUI */ @Transient public Dimension getMinimumSize() { if (isMinimumSizeSet()) { return super.getMinimumSize(); } Dimension size = null; if (ui != null) { size = ui.getMinimumSize(this); } return (size != null) ? size : super.getMinimumSize(); }
/** * Gets the foreground color of this component. * @return this component's foreground color; if this component does * not have a foreground color, the foreground color of its parent * is returned * @see #setForeground * @since 1.0 */ @Transient public Color getForeground() { Color foreground = this.foreground; if (foreground != null) { return foreground; } Container parent = this.parent; return (parent != null) ? parent.getForeground() : null; }
/** * Gets the background color of this component. * @return this component's background color; if this component does * not have a background color, * the background color of its parent is returned * @see #setBackground * @since JDK1.0 */ @Transient public Color getBackground() { Color background = this.background; if (background != null) { return background; } Container parent = this.parent; return (parent != null) ? parent.getBackground() : null; }
/** * Returns the currently selected component for this tabbedpane. * Returns <code>null</code> if there is no currently selected tab. * * @return the component corresponding to the selected tab * @see #setSelectedComponent */ @Transient public Component getSelectedComponent() { int index = getSelectedIndex(); if (index == -1) { return null; } return getComponentAt(index); }
@Override @Transient(false) public Object getProperty() { return this; }
@Override @Transient public Object getProperty() { return this; }
@Transient public List<String> getRemoveKeys() { return this.removeKeys; }
@Transient public int getId() { return id; }
@Override @Transient public Dimension getMinimumSize() { return getDimension(); }
@Override @Transient public Dimension getMaximumSize() { return getDimension(); }
@Override @Transient public Dimension getPreferredSize() { return getDimension(); }
@Transient public Object getProperty() { return this; }
@Override @Transient(false) public void addEventSetListener(EventSetListener listener) { }
@Override @Transient public void addEventSetListener(EventSetListener listener) { }
@Override @Transient(false) public void setProperty(Object object) { }
@Transient public String getComment() { return this.comment; }
@Override @Transient public void removeEventSetListener(EventSetListener listener) { }
@Override @Transient public void setProperty(Object object) { }
/** {@inheritDoc} */ @Transient public int getAnchorSelectionIndex() { return anchorIndex; }
private boolean isTransient(PropertyDescriptor propertyDescriptor) { return propertyDescriptor.getReadMethod().getAnnotation(Transient.class) != null || propertyDescriptor.getWriteMethod().getAnnotation(Transient.class) != null; }
@Override @Transient(false) public void removeEventSetListener(EventSetListener listener) { }
@Transient public void addEventSetListener(EventSetListener listener) { }
/** * Returns this icon's <code>Image</code>. * @return the <code>Image</code> object for this <code>ImageIcon</code> */ @Transient public Image getImage() { return image; }
@Transient JToggleButton getCurrentButton() { return cb.isVisible() ? cb : rb; }
@Transient public void setTransientProperty(char transientProperty) { this.transientProperty = transientProperty; }
@Transient(false) public void removeEventSetListener(EventSetListener listener) { }