- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.PanelUI
-
- javax.swing.plaf.basic.BasicPanelUI
-
- javax.swing.plaf.synth.SynthPanelUI
-
- All Implemented Interfaces:
- PropertyChangeListener, EventListener, SynthConstants, SynthUI
public class SynthPanelUI extends BasicPanelUI implements PropertyChangeListener, SynthUI
Provides the Synth L&F UI delegate forJPanel
.- Since:
- 1.7
-
-
Constructor Summary
Constructors Constructor and Description SynthPanelUI()
-
Method Summary
Methods Modifier and Type Method and Description static ComponentUI
createUI(JComponent c)
Creates a new UI object for the given component.SynthContext
getContext(JComponent c)
Returns the Context for the specified component.protected void
installDefaults(JPanel p)
protected void
installListeners(JPanel p)
Installs listeners into the panel.void
installUI(JComponent c)
Configures the specified component appropriately for the look and feel.void
paint(Graphics g, JComponent c)
Paints the specified component according to the Look and Feel.protected void
paint(SynthContext context, Graphics g)
Paints the specified component.void
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
Paints the border.void
propertyChange(PropertyChangeEvent pce)
This method gets called when a bound property is changed.protected void
uninstallDefaults(JPanel p)
protected void
uninstallListeners(JPanel p)
Uninstalls listeners from the panel.void
uninstallUI(JComponent c)
Reverses configuration which was done on the specified component duringinstallUI
.void
update(Graphics g, JComponent c)
Notifies this UI delegate to repaint the specified component.-
Methods inherited from class javax.swing.plaf.basic.BasicPanelUI
getBaseline, getBaselineResizeBehavior
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize
-
-
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
Creates a new UI object for the given component.- Parameters:
c
- component to create UI object for- Returns:
- the UI object
-
installUI
public void installUI(JComponent c)
Description copied from class:ComponentUI
Configures the specified component appropriately for the look and feel. This method is invoked when theComponentUI
instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:- Install default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
- Install a
LayoutManager
on the component if necessary. - Create/add any required sub-components to the component.
- Create/install event listeners on the component.
- Create/install a
PropertyChangeListener
on the component in order to detect and respond to component property changes appropriately. - Install keyboard UI (mnemonics, traversal, etc.) on the component.
- Initialize any appropriate instance data.
- Overrides:
installUI
in classBasicPanelUI
- Parameters:
c
- the 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)
Description copied from class:ComponentUI
Reverses configuration which was done on the specified component duringinstallUI
. This method is invoked when thisUIComponent
instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed ininstallUI
, being careful to leave theJComponent
instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:- Remove any UI-set borders from the component.
- Remove any UI-set layout managers on the component.
- Remove any UI-added sub-components from the component.
- Remove any UI-added event/property listeners from the component.
- Remove any UI-installed keyboard UI from the component.
- Nullify any allocated instance data objects to allow for GC.
- Overrides:
uninstallUI
in classBasicPanelUI
- Parameters:
c
- the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- See Also:
ComponentUI.installUI(javax.swing.JComponent)
,JComponent.updateUI()
-
installListeners
protected void installListeners(JPanel p)
Installs listeners into the panel.- Parameters:
p
- theJPanel
object
-
uninstallListeners
protected void uninstallListeners(JPanel p)
Uninstalls listeners from the panel.- Parameters:
p
- theJPanel
object
-
installDefaults
protected void installDefaults(JPanel p)
- Overrides:
installDefaults
in classBasicPanelUI
-
uninstallDefaults
protected void uninstallDefaults(JPanel p)
- Overrides:
uninstallDefaults
in classBasicPanelUI
-
getContext
public SynthContext getContext(JComponent c)
Description copied from interface:SynthUI
Returns the Context for the specified component.- Specified by:
getContext
in interfaceSynthUI
- Parameters:
c
- Component requesting SynthContext.- Returns:
- SynthContext describing component.
-
update
public void update(Graphics g, JComponent c)
Notifies this UI delegate to repaint the specified component. This method paints the component background, then calls thepaint(SynthContext,Graphics)
method.In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the
paint
method.- Overrides:
update
in classComponentUI
- Parameters:
g
- theGraphics
object used for paintingc
- the component being painted- See Also:
paint(SynthContext,Graphics)
-
paint
public void paint(Graphics g, JComponent c)
Paints the specified component according to the Look and Feel.This method is not used by Synth Look and Feel. Painting is handled by the
paint(SynthContext,Graphics)
method.- Overrides:
paint
in classComponentUI
- Parameters:
g
- theGraphics
object used for paintingc
- the component being painted- See Also:
paint(SynthContext,Graphics)
-
paint
protected void paint(SynthContext context, Graphics g)
Paints the specified component. This implementation does nothing.- Parameters:
context
- context for the component being paintedg
- theGraphics
object used for painting- See Also:
update(Graphics,JComponent)
-
paintBorder
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
Description copied from interface:SynthUI
Paints the border.- Specified by:
paintBorder
in interfaceSynthUI
- Parameters:
context
- a component contextg
-Graphics
to paint onx
- the X coordinatey
- the Y coordinatew
- width of the borderh
- height of the border
-
propertyChange
public void propertyChange(PropertyChangeEvent pce)
Description copied from interface:PropertyChangeListener
This method gets called when a bound property is changed.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
pce
- A PropertyChangeEvent object describing the event source and the property that has changed.
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/swing/plaf/synth/synthpanelui.html/.html/
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.