APIdia Launch Partner
Top Fields Constructors Methods
javax.swing.colorchooser

pack-priv final Class DiagramComponent

extends JComponent
implements MouseListener, MouseMotionListener
Class Inheritance
All Implemented Interfaces
java.awt.event.MouseMotionListener, java.util.EventListener, java.awt.event.MouseListener
Annotations
@SuppressWarnings:serial
Imports
java.awt.Color, .Graphics, .Insets, java.awt.event.MouseEvent, .MouseListener, .MouseMotionListener, java.awt.image.BufferedImage, javax.swing.JComponent

Field Summary

Modifier and TypeField and Description
private int[]
private final boolean
private int
private BufferedImage
private final Insets
private final ColorPanel
private int
Inherited from javax.swing.JComponent:
listenerListTOOL_TIP_TEXT_KEYuiUNDEFINED_CONDITIONWHEN_ANCESTOR_OF_FOCUSED_COMPONENTWHEN_FOCUSEDWHEN_IN_FOCUSED_WINDOW

Constructor Summary

AccessConstructor and Description
pack-priv
DiagramComponent(ColorPanel panel, boolean diagram)

Method Summary

Modifier and TypeMethod and Description
private static int
getValue(float value, int min, int max)

private static float
getValue(int value, int min, int max)

public void
mouseClicked(MouseEvent event)

Implements java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

public void
mouseDragged(MouseEvent event)

Implements java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged.

public void
mouseEntered(MouseEvent event)

Implements java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

public void
mouseExited(MouseEvent event)

Implements java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

public void
mouseMoved(MouseEvent event)

Implements java.awt.event.MouseMotionListener.mouseMoved.

Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.

public void
mousePressed(MouseEvent event)

Implements java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

public void
mouseReleased(MouseEvent event)

Implements java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

protected void
paintComponent(Graphics g)

Overrides javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null.

Inherited from javax.swing.JComponent:
addAncestorListeneraddNotifyaddVetoableChangeListenercomputeVisibleRectcontainscreateToolTipdisableenablefirePropertyChangefirePropertyChangefirePropertyChangefireVetoableChangegetActionForKeyStrokegetActionMapgetAlignmentXgetAlignmentYgetAncestorListenersgetAutoscrollsgetBaselinegetBaselineResizeBehaviorgetBordergetBoundsgetClientPropertygetComponentGraphicsgetComponentPopupMenugetConditionForKeyStrokegetDebugGraphicsOptionsgetDefaultLocalegetFontMetricsgetGraphicsgetHeightgetInheritsPopupMenugetInputMapgetInputMapgetInputVerifiergetInsetsgetInsetsgetListenersgetLocationgetMaximumSizegetMinimumSizegetNextFocusableComponentgetPopupLocationgetPreferredSizegetRegisteredKeyStrokesgetRootPanegetSizegetToolTipLocationgetToolTipTextgetToolTipTextgetTopLevelAncestorgetTransferHandlergetUIgetUIClassIDgetVerifyInputWhenFocusTargetgetVetoableChangeListenersgetVisibleRectgetWidthgetXgetYgrabFocushideisDoubleBufferedisLightweightComponentisManagingFocusisOpaqueisOptimizedDrawingEnabledisPaintingForPrintisPaintingOriginisPaintingTileisRequestFocusEnabledisValidateRootpaintpaintBorderpaintChildrenpaintImmediatelypaintImmediatelyparamStringprintprintAllprintBorderprintChildrenprintComponentprocessComponentKeyEventprocessKeyBindingprocessKeyEventprocessMouseEventprocessMouseMotionEventputClientPropertyregisterKeyboardActionregisterKeyboardActionremoveAncestorListenerremoveNotifyremoveVetoableChangeListenerrepaintrepaintrequestDefaultFocusrequestFocusrequestFocusrequestFocusInWindowrequestFocusInWindowresetKeyboardActionsreshaperevalidatescrollRectToVisiblesetActionMapsetAlignmentXsetAlignmentYsetAutoscrollssetBackgroundsetBordersetComponentPopupMenusetDebugGraphicsOptionssetDefaultLocalesetDoubleBufferedsetEnabledsetFocusTraversalKeyssetFontsetForegroundsetInheritsPopupMenusetInputMapsetInputVerifiersetMaximumSizesetMinimumSizesetNextFocusableComponentsetOpaquesetPreferredSizesetRequestFocusEnabledsetToolTipTextsetTransferHandlersetUIsetVerifyInputWhenFocusTargetsetVisibleunregisterKeyboardActionupdateupdateUI

Field Detail

arrayback to summary
private int[] array
diagramback to summary
private final boolean diagram
heightback to summary
private int height

Hides java.awt.Component.height.

imageback to summary
private BufferedImage image
insetsback to summary
private final Insets insets
panelback to summary
private final ColorPanel panel
widthback to summary
private int width

Hides java.awt.Component.width.

Constructor Detail

DiagramComponentback to summary
pack-priv DiagramComponent(ColorPanel panel, boolean diagram)

Method Detail

getValueback to summary
private static int getValue(float value, int min, int max)
getValueback to summary
private static float getValue(int value, int min, int max)
mouseClickedback to summary
public void mouseClicked(MouseEvent event)

Implements java.awt.event.MouseListener.mouseClicked.

Doc from java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

mouseDraggedback to summary
public void mouseDragged(MouseEvent event)

Implements java.awt.event.MouseMotionListener.mouseDragged.

Doc from java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged. MOUSE_DRAGGED events will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Due to platform-dependent Drag&Drop implementations, MOUSE_DRAGGED events may not be delivered during a native Drag&Drop operation.

mouseEnteredback to summary
public void mouseEntered(MouseEvent event)

Implements java.awt.event.MouseListener.mouseEntered.

Doc from java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

mouseExitedback to summary
public void mouseExited(MouseEvent event)

Implements java.awt.event.MouseListener.mouseExited.

Doc from java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

mouseMovedback to summary
public void mouseMoved(MouseEvent event)

Implements java.awt.event.MouseMotionListener.mouseMoved.

Doc from java.awt.event.MouseMotionListener.mouseMoved.

Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.

mousePressedback to summary
public void mousePressed(MouseEvent event)

Implements java.awt.event.MouseListener.mousePressed.

Doc from java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

mouseReleasedback to summary
public void mouseReleased(MouseEvent event)

Implements java.awt.event.MouseListener.mouseReleased.

Doc from java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

paintComponentback to summary
protected void paintComponent(Graphics g)

Overrides javax.swing.JComponent.paintComponent.

Doc from javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate).

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoke super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in an opaque color. If you do not honor the opaque property you will likely see visual artifacts.

The passed in Graphics object might have a transform other than the identify transform installed on it. In this case, you might get unexpected results if you cumulatively apply another transform.

Annotations
@Override