javax.swing.plaf
Class LayerUI<V extends Component>

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.LayerUI<V>
Type Parameters:
V - one of the super types of JLayer's view component
All Implemented Interfaces:
Serializable

public class LayerUI<V extends Component>
extends ComponentUI
implements Serializable

Disabled: no SafeJ information.

The base class for all JLayer's UI delegates.

paint(java.awt.Graphics, javax.swing.JComponent) method performes the painting of the JLayer and eventDispatched(AWTEvent, JLayer) method is notified about any AWTEvents which have been generated by a JLayer or any of its subcomponents.

The LayerUI differs from the UI delegates of the other components, because it is LookAndFeel independent and is not updated by default when the system LookAndFeel is changed.

The subclasses of LayerUI can either be stateless and shareable by multiple JLayers or not shareable.

Since:
1.7
See Also:
JLayer.setUI(LayerUI), JLayer.setView(Component), JLayer.getView()

Constructor Summary
LayerUI()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list for a specific property.
 void applyPropertyChange(PropertyChangeEvent evt, JLayer<? extends V> l)
          Notifies the LayerUI when any of its property are changed and enables updating every JLayer this LayerUI instance is set to.
protected  void configureGraphics(Graphics2D g2, JLayer<? extends V> l)
          This method is called by the paint(java.awt.Graphics, javax.swing.JComponent) method prior to paintLayer(java.awt.Graphics2D, javax.swing.JLayer) to configure the Graphics2D object.
 void eventDispatched(AWTEvent e, JLayer<? extends V> l)
          Dispatches AWTEvents for JLayer and all its subcomponents to this LayerUI instance.
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Support for reporting bound property changes for Object properties.
 int getBaseline(JComponent c, int width, int height)
          If the JLayer's view component is not null, this calls the view's getBaseline() method.
 Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
          If the JLayer's view component is not null, this calls the view's getBaselineResizeBehavior() method.
 Dimension getPreferredScrollableViewportSize(JLayer<? extends V> l)
          Returns the preferred size of the viewport for a view component.
 PropertyChangeListener[] getPropertyChangeListeners()
          Returns an array of all the property change listeners registered on this component.
 PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
          Returns an array of all the listeners which have been associated with the named property.
 int getScrollableBlockIncrement(JLayer<? extends V> l, Rectangle visibleRect, int orientation, int direction)
          Returns a scroll increment, which is required for components that display logical rows or columns in order to completely expose one block of rows or columns, depending on the value of orientation.
 boolean getScrollableTracksViewportHeight(JLayer<? extends V> l)
          Returns false to indicate that the height of the viewport does not determine the height of the layer, unless the preferred height of the layer is smaller than the height of the viewport.
 boolean getScrollableTracksViewportWidth(JLayer<? extends V> l)
          Returns false to indicate that the width of the viewport does not determine the width of the layer, unless the preferred width of the layer is smaller than the width of the viewport.
 int getScrollableUnitIncrement(JLayer<? extends V> l, Rectangle visibleRect, int orientation, int direction)
          Returns a scroll increment, which is required for components that display logical rows or columns in order to completely expose one new row or column, depending on the value of orientation.
 void installUI(JComponent c)
          Configures the JLayer this LayerUI is set to.
 void paint(Graphics g, JComponent c)
          Paints the specified component.
protected  void paintLayer(Graphics2D g2, JLayer<? extends V> l)
          Called by the paint(java.awt.Graphics, javax.swing.JComponent) method, subclasses should override this method to perform any custom painting operations.
protected  void processComponentEvent(ComponentEvent e, JLayer<? extends V> l)
          Processes component events occurring on the JLayer or any of its subcomponents.
protected  void processFocusEvent(FocusEvent e, JLayer<? extends V> l)
          Processes focus events occurring on the JLayer or any of its subcomponents.
protected  void processHierarchyBoundsEvent(HierarchyEvent e, JLayer<? extends V> l)
          Processes hierarchy bounds event occurring on the JLayer or any of its subcomponents.
protected  void processHierarchyEvent(HierarchyEvent e, JLayer<? extends V> l)
          Processes hierarchy event occurring on the JLayer or any of its subcomponents.
protected  void processInputMethodEvent(InputMethodEvent e, JLayer<? extends V> l)
          Processes input event occurring on the JLayer or any of its subcomponents.
protected  void processKeyEvent(KeyEvent e, JLayer<? extends V> l)
          Processes key events occurring on the JLayer or any of its subcomponents.
protected  void processMouseEvent(MouseEvent e, JLayer<? extends V> l)
          Processes mouse events occurring on the JLayer or any of its subcomponents.
protected  void processMouseMotionEvent(MouseEvent e, JLayer<? extends V> l)
          Processes mouse motion event occurring on the JLayer or any of its subcomponents.
protected  void processMouseWheelEvent(MouseWheelEvent e, JLayer<? extends V> l)
          Processes mouse wheel event occurring on the JLayer or any of its subcomponents.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list for a specific property.
protected  void repaintLayer()
          Repaints all JLayer instances this LayerUI is set to.
 void uninstallUI(JComponent c)
          Reverses the configuration which was previously set in the installUI(JComponent) method.
 void updateUI(JLayer<? extends V> l)
          Invoked when JLayer.updateUI() is called by the JLayer this LayerUI is set to.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayerUI

public LayerUI()
Class is disabled.

Method Detail

paint

public void paint(Graphics g,
                  JComponent c)
Class is disabled.

Paints the specified component. Subclasses should override this method and use the specified Graphics object to render the content of the component.

If g is not an instance of Graphics2D, this method is no-op.

Overrides:
paint in class ComponentUI
Parameters:
g - the Graphics context in which to paint;
c - the component being painted; it can be safely cast to JLayer<? extends V>
See Also:
configureGraphics(Graphics2D, JLayer), paintLayer(Graphics2D, JLayer)

configureGraphics

protected void configureGraphics(Graphics2D g2,
                                 JLayer<? extends V> l)
Class is disabled.

This method is called by the paint(java.awt.Graphics, javax.swing.JComponent) method prior to paintLayer(java.awt.Graphics2D, javax.swing.JLayer) to configure the Graphics2D object. The default implementation is empty.

Parameters:
g2 - the Graphics2D object to configure
l - the JLayer being painted
See Also:
paintLayer(Graphics2D, JLayer)

paintLayer

protected void paintLayer(Graphics2D g2,
                          JLayer<? extends V> l)
Class is disabled.

Called by the paint(java.awt.Graphics, javax.swing.JComponent) method, subclasses should override this method to perform any custom painting operations.

The default implementation paints the passed JLayer as is.

Parameters:
g2 - the Graphics2D context in which to paint
l - the JLayer being painted
See Also:
configureGraphics(Graphics2D, JLayer)

eventDispatched

public void eventDispatched(AWTEvent e,
                            JLayer<? extends V> l)
Class is disabled.

Dispatches AWTEvents for JLayer and all its subcomponents to this LayerUI instance.

To enable the AWTEvents of a particular type, you call JLayer.setLayerEventMask(long) in installUI(javax.swing.JComponent) and set the layer event mask to 0 in uninstallUI(javax.swing.JComponent) after that. By default this method calls the appropriate process&lt;event&nbsp;type&gt;Event method for the given class of event.

Parameters:
e - the event to be dispatched
l - the layer this LayerUI is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent), processComponentEvent(java.awt.event.ComponentEvent, javax.swing.JLayer), processFocusEvent(java.awt.event.FocusEvent, javax.swing.JLayer), processKeyEvent(java.awt.event.KeyEvent, javax.swing.JLayer), processMouseEvent(java.awt.event.MouseEvent, javax.swing.JLayer), processMouseMotionEvent(java.awt.event.MouseEvent, javax.swing.JLayer), processInputMethodEvent(java.awt.event.InputMethodEvent, javax.swing.JLayer), processHierarchyEvent(java.awt.event.HierarchyEvent, javax.swing.JLayer), processMouseWheelEvent(java.awt.event.MouseWheelEvent, javax.swing.JLayer)

processComponentEvent

protected void processComponentEvent(ComponentEvent e,
                                     JLayer<? extends V> l)
Class is disabled.

Processes component events occurring on the JLayer or any of its subcomponents.

This method is not called unless component events are enabled for the JLayer objects, this LayerUI is set to. Component events are enabled in the overridden installUI(javax.swing.JComponent) method and should be disabled in the uninstallUI(javax.swing.JComponent) method after that.

 public void installUI(JComponent c) {
    super.installUI(c);
    JLayer l = (JLayer) c;
    l.setLayerEventMask(AWTEvent.COMPONENT_EVENT_MASK);
 }

 public void unistallUI(JComponent c) {
     super.uninstallUI(c);
     JLayer l = (JLayer) c;
     l.setLayerEventMask(0);
 }
 

Parameters:
e - the ComponentEvent to be processed
l - the layer this LayerUI instance is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent)

processFocusEvent

protected void processFocusEvent(FocusEvent e,
                                 JLayer<? extends V> l)
Class is disabled.

Processes focus events occurring on the JLayer or any of its subcomponents.

This method is not called unless focus events are enabled for the JLayer objects, this LayerUI is set to. Focus events are enabled in the overridden installUI(javax.swing.JComponent) method and should be disabled in the uninstallUI(javax.swing.JComponent) method after that.

 public void installUI(JComponent c) {
    super.installUI(c);
    JLayer l = (JLayer) c;
    l.setLayerEventMask(AWTEvent.FOCUS_EVENT_MASK);
 }

 public void unistallUI(JComponent c) {
     super.uninstallUI(c);
     JLayer l = (JLayer) c;
     l.setLayerEventMask(0);
 }
 

Parameters:
e - the FocusEvent to be processed
l - the layer this LayerUI instance is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent)

processKeyEvent

protected void processKeyEvent(KeyEvent e,
                               JLayer<? extends V> l)
Class is disabled.

Processes key events occurring on the JLayer or any of its subcomponents.

This method is not called unless key events are enabled for the JLayer objects, this LayerUI is set to. Key events are enabled in the overridden installUI(javax.swing.JComponent) method and should be disabled in the uninstallUI(javax.swing.JComponent) method after that.

 public void installUI(JComponent c) {
    super.installUI(c);
    JLayer l = (JLayer) c;
    l.setLayerEventMask(AWTEvent.KEY_EVENT_MASK);
 }

 public void unistallUI(JComponent c) {
     super.uninstallUI(c);
     JLayer l = (JLayer) c;
     l.setLayerEventMask(0);
 }
 

Parameters:
e - the KeyEvent to be processed
l - the layer this LayerUI instance is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent)

processMouseEvent

protected void processMouseEvent(MouseEvent e,
                                 JLayer<? extends V> l)
Class is disabled.

Processes mouse events occurring on the JLayer or any of its subcomponents.

This method is not called unless mouse events are enabled for the JLayer objects, this LayerUI is set to. Mouse events are enabled in the overridden installUI(javax.swing.JComponent) method and should be disabled in the uninstallUI(javax.swing.JComponent) method after that.

 public void installUI(JComponent c) {
    super.installUI(c);
    JLayer l = (JLayer) c;
    l.setLayerEventMask(AWTEvent.MOUSE_EVENT_MASK);
 }

 public void unistallUI(JComponent c) {
     super.uninstallUI(c);
     JLayer l = (JLayer) c;
     l.setLayerEventMask(0);
 }
 

Parameters:
e - the MouseEvent to be processed
l - the layer this LayerUI instance is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent)

processMouseMotionEvent

protected void processMouseMotionEvent(MouseEvent e,
                                       JLayer<? extends V> l)
Class is disabled.

Processes mouse motion event occurring on the JLayer or any of its subcomponents.

This method is not called unless mouse motion events are enabled for the JLayer objects, this LayerUI is set to. Mouse motion events are enabled in the overridden installUI(javax.swing.JComponent) method and should be disabled in the uninstallUI(javax.swing.JComponent) method after that.

 public void installUI(JComponent c) {
    super.installUI(c);
    JLayer l = (JLayer) c;
    l.setLayerEventMask(AWTEvent.MOUSE_MOTION_EVENT_MASK);
 }

 public void unistallUI(JComponent c) {
     super.uninstallUI(c);
     JLayer l = (JLayer) c;
     l.setLayerEventMask(0);
 }
 

Parameters:
e - the MouseEvent to be processed
l - the layer this LayerUI instance is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent)

processMouseWheelEvent

protected void processMouseWheelEvent(MouseWheelEvent e,
                                      JLayer<? extends V> l)
Class is disabled.

Processes mouse wheel event occurring on the JLayer or any of its subcomponents.

This method is not called unless mouse wheel events are enabled for the JLayer objects, this LayerUI is set to. Mouse wheel events are enabled in the overridden installUI(javax.swing.JComponent) method and should be disabled in the uninstallUI(javax.swing.JComponent) method after that.

 public void installUI(JComponent c) {
    super.installUI(c);
    JLayer l = (JLayer) c;
    l.setLayerEventMask(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
 }

 public void unistallUI(JComponent c) {
     super.uninstallUI(c);
     JLayer l = (JLayer) c;
     l.setLayerEventMask(0);
 }
 

Parameters:
e - the MouseEvent to be processed
l - the layer this LayerUI instance is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent)

processInputMethodEvent

protected void processInputMethodEvent(InputMethodEvent e,
                                       JLayer<? extends V> l)
Class is disabled.

Processes input event occurring on the JLayer or any of its subcomponents.

This method is not called unless input events are enabled for the JLayer objects, this LayerUI is set to. Input events are enabled in the overridden installUI(javax.swing.JComponent) method and should be disabled in the uninstallUI(javax.swing.JComponent) method after that.

 public void installUI(JComponent c) {
    super.installUI(c);
    JLayer l = (JLayer) c;
    l.setLayerEventMask(AWTEvent.INPUT_METHOD_EVENT_MASK);
 }

 public void unistallUI(JComponent c) {
     super.uninstallUI(c);
     JLayer l = (JLayer) c;
     l.setLayerEventMask(0);
 }
 

Parameters:
e - the InputMethodEvent to be processed
l - the layer this LayerUI instance is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent)

processHierarchyEvent

protected void processHierarchyEvent(HierarchyEvent e,
                                     JLayer<? extends V> l)
Class is disabled.

Processes hierarchy event occurring on the JLayer or any of its subcomponents.

This method is not called unless hierarchy events are enabled for the JLayer objects, this LayerUI is set to. Hierarchy events are enabled in the overridden installUI(javax.swing.JComponent) method and should be disabled in the uninstallUI(javax.swing.JComponent) method after that.

 public void installUI(JComponent c) {
    super.installUI(c);
    JLayer l = (JLayer) c;
    l.setLayerEventMask(AWTEvent.HIERARCHY_EVENT_MASK);
 }

 public void unistallUI(JComponent c) {
     super.uninstallUI(c);
     JLayer l = (JLayer) c;
     l.setLayerEventMask(0);
 }
 

Parameters:
e - the HierarchyEvent to be processed
l - the layer this LayerUI instance is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent)

processHierarchyBoundsEvent

protected void processHierarchyBoundsEvent(HierarchyEvent e,
                                           JLayer<? extends V> l)
Class is disabled.

Processes hierarchy bounds event occurring on the JLayer or any of its subcomponents.

This method is not called unless hierarchy bounds events are enabled for the JLayer objects, this LayerUI is set to. Hierarchy bounds events are enabled in the overridden installUI(javax.swing.JComponent) method and should be disabled in the uninstallUI(javax.swing.JComponent) method after that.

 public void installUI(JComponent c) {
    super.installUI(c);
    JLayer l = (JLayer) c;
    l.setLayerEventMask(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
 }

 public void unistallUI(JComponent c) {
     super.uninstallUI(c);
     JLayer l = (JLayer) c;
     l.setLayerEventMask(0);
 }
 

Parameters:
e - the HierarchyEvent to be processed
l - the layer this LayerUI instance is set to
See Also:
JLayer.setLayerEventMask(long), installUI(javax.swing.JComponent), uninstallUI(javax.swing.JComponent)

updateUI

public void updateUI(JLayer<? extends V> l)
Class is disabled.

Invoked when JLayer.updateUI() is called by the JLayer this LayerUI is set to.

Parameters:
l - the JLayer which UI is updated

installUI

public void installUI(JComponent c)
Class is disabled.

Configures the JLayer this LayerUI is set to. The default implementation registers the LayerUI as a property change listener for the passed JLayer component.

Overrides:
installUI in class ComponentUI
Parameters:
c - the JLayer component where this UI delegate is being installed
See Also:
ComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

uninstallUI

public void uninstallUI(JComponent c)
Class is disabled.

Reverses the configuration which was previously set in the installUI(JComponent) method. The default implementation unregisters the property change listener for the passed JLayer component.

Overrides:
uninstallUI in class ComponentUI
Parameters:
c - the component from which this UI delegate is being removed.
See Also:
ComponentUI.installUI(javax.swing.JComponent), JComponent.updateUI()

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Class is disabled.

Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the property change listener to be added
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener), getPropertyChangeListeners(), addPropertyChangeListener(String, java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Class is disabled.

Removes a PropertyChangeListener from the listener list. This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), getPropertyChangeListeners(), removePropertyChangeListener(String, PropertyChangeListener)

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners()
Class is disabled.

Returns an array of all the property change listeners registered on this component.

Returns:
all of this ui's PropertyChangeListeners or an empty array if no property change listeners are currently registered
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener), removePropertyChangeListener(java.beans.PropertyChangeListener), getPropertyChangeListeners(String)

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Class is disabled.

Adds a PropertyChangeListener to the listener list for a specific property.

If propertyName or listener is null, no exception is thrown and no action is taken.

Parameters:
propertyName - one of the property names listed above
listener - the property change listener to be added
See Also:
removePropertyChangeListener(String, PropertyChangeListener), getPropertyChangeListeners(String), addPropertyChangeListener(String, PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Class is disabled.

Removes a PropertyChangeListener from the listener list for a specific property. This method should be used to remove PropertyChangeListeners that were registered for a specific bound property.

If propertyName or listener is null, no exception is thrown and no action is taken.

Parameters:
propertyName - a valid property name
listener - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(String, PropertyChangeListener), getPropertyChangeListeners(String), removePropertyChangeListener(PropertyChangeListener)

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
Class is disabled.

Returns an array of all the listeners which have been associated with the named property.

Parameters:
propertyName - The name of the property being listened to
Returns:
all of the PropertyChangeListeners associated with the named property; if no such listeners have been added or if propertyName is null, an empty array is returned
See Also:
addPropertyChangeListener(String, PropertyChangeListener), removePropertyChangeListener(String, PropertyChangeListener), getPropertyChangeListeners()

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Class is disabled.

Support for reporting bound property changes for Object properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.

Parameters:
propertyName - the property whose value has changed
oldValue - the property's previous value
newValue - the property's new value

repaintLayer

protected void repaintLayer()
Class is disabled.

Repaints all JLayer instances this LayerUI is set to. Call this method when the state of this LayerUI is changed and the visual appearance of its JLayer objects needs to be updated.

See Also:
Component.repaint()

applyPropertyChange

public void applyPropertyChange(PropertyChangeEvent evt,
                                JLayer<? extends V> l)
Class is disabled.

Notifies the LayerUI when any of its property are changed and enables updating every JLayer this LayerUI instance is set to.

Parameters:
evt - the PropertyChangeEvent generated by this LayerUI
l - the JLayer this LayerUI is set to

getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize(JLayer<? extends V> l)
Class is disabled.

Returns the preferred size of the viewport for a view component.

Parameters:
l - the JLayer component where this UI delegate is being installed
Returns:
the preferred size of the viewport for a view component
See Also:
Scrollable.getPreferredScrollableViewportSize()

getScrollableBlockIncrement

public int getScrollableBlockIncrement(JLayer<? extends V> l,
                                       Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Class is disabled.

Returns a scroll increment, which is required for components that display logical rows or columns in order to completely expose one block of rows or columns, depending on the value of orientation.

Parameters:
l - the JLayer component where this UI delegate is being installed
visibleRect - The view area visible within the viewport
orientation - Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.
direction - Less than zero to scroll up/left, greater than zero for down/right.
Returns:
the "block" increment for scrolling in the specified direction
See Also:
Scrollable.getScrollableBlockIncrement(Rectangle, int, int)

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight(JLayer<? extends V> l)
Class is disabled.

Returns false to indicate that the height of the viewport does not determine the height of the layer, unless the preferred height of the layer is smaller than the height of the viewport.

Parameters:
l - the JLayer component where this UI delegate is being installed
Returns:
whether the layer should track the height of the viewport
See Also:
Scrollable.getScrollableTracksViewportHeight()

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth(JLayer<? extends V> l)
Class is disabled.

Returns false to indicate that the width of the viewport does not determine the width of the layer, unless the preferred width of the layer is smaller than the width of the viewport.

Parameters:
l - the JLayer component where this UI delegate is being installed
Returns:
whether the layer should track the width of the viewport
See Also:
Scrollable, getScrollableTracksViewportWidth(JLayer)

getScrollableUnitIncrement

public int getScrollableUnitIncrement(JLayer<? extends V> l,
                                      Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Class is disabled.

Returns a scroll increment, which is required for components that display logical rows or columns in order to completely expose one new row or column, depending on the value of orientation. Ideally, components should handle a partially exposed row or column by returning the distance required to completely expose the item.

Scrolling containers, like JScrollPane, will use this method each time the user requests a unit scroll.

Parameters:
l - the JLayer component where this UI delegate is being installed
visibleRect - The view area visible within the viewport
orientation - Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.
direction - Less than zero to scroll up/left, greater than zero for down/right.
Returns:
The "unit" increment for scrolling in the specified direction. This value should always be positive.
See Also:
Scrollable.getScrollableUnitIncrement(Rectangle, int, int)

getBaseline

public int getBaseline(JComponent c,
                       int width,
                       int height)
Class is disabled.

If the JLayer's view component is not null, this calls the view's getBaseline() method. Otherwise, the default implementation is called.

Overrides:
getBaseline in class ComponentUI
Parameters:
c - JLayer to return baseline resize behavior for
width - the width to get the baseline for
height - the height to get the baseline for
Returns:
baseline or a value < 0 indicating there is no reasonable baseline
See Also:
JComponent.getBaseline(int,int)

getBaselineResizeBehavior

public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
Class is disabled.

If the JLayer's view component is not null, this calls the view's getBaselineResizeBehavior() method. Otherwise, the default implementation is called.

Overrides:
getBaselineResizeBehavior in class ComponentUI
Parameters:
c - JLayer to return baseline resize behavior for
Returns:
an enum indicating how the baseline changes as the component size changes
See Also:
JComponent.getBaseline(int, int)