edu.princeton.swing
public class PHyperlink extends javax.swing.AbstractButton
| Modifier and Type | Class and Description | 
|---|---|
| static class  | PHyperlink.HyperlinkButtonModelHyperlinkButtonModel is similar to JToggleButton.ToggleButtonModel except that once it is
 selected, it doesn't ever toggle back without an explicit setSelected() call. | 
| protected class  | PHyperlink.ListenerListener implements ChangeListener to listen for changes in the ButtonModel's state and
 MouseListener to listen for mouse actions on the label. | 
| static class  | PHyperlink.UnderlineBorderUnderlineBorder is a simple subclass of AbstractBorder that draws an underline. | 
javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.AbstractButton.ButtonChangeListenerjavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description | 
|---|---|
| static byte | BLUE_STYLE | 
| static byte | CLASSIC_HOVER_STYLE | 
| static byte | CLASSIC_STYLE | 
| static byte | METAL_STYLE | 
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTYaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description | 
|---|
| PHyperlink()Create a new PHyperlink. | 
| PHyperlink(javax.swing.Action a)Create a new PHyperlink. | 
| PHyperlink(javax.swing.Action a,
          byte style)Create a new PHyperlink. | 
| PHyperlink(java.lang.String text)Create a new PHyperlink. | 
| PHyperlink(java.lang.String text,
          javax.swing.Icon icon)Create a new PHyperlink. | 
| PHyperlink(java.lang.String text,
          javax.swing.Icon icon,
          byte style)Create a new PHyperlink. | 
| PHyperlink(java.lang.String text,
          javax.swing.Icon icon,
          java.awt.Color linkColor,
          boolean linkUnderline,
          java.awt.Color hoverColor,
          boolean hoverUnderline,
          java.awt.Color disabledColor,
          boolean disabledUnderline,
          java.awt.Color visitedColor,
          boolean visitedUnderline,
          java.awt.Color visitedHoverColor,
          boolean visitedHoverUnderline,
          java.awt.Color visitedDisabledColor,
          boolean visitedDisabledUnderline,
          java.awt.Color activeColor,
          boolean activeUnderline)Create a new PHyperlink. | 
| Modifier and Type | Method and Description | 
|---|---|
| java.awt.Color | getActiveColor()Returns the color of the link in an active, non-disabled state. | 
| boolean | getActiveUnderline()Returns wheter or not to underline the link in an active, non-disabled state. | 
| java.awt.Color | getDisabledColor()Returns the color of the link in a non-visited, disabled state. | 
| boolean | getDisabledUnderline()Returns wheter or not to underline the link in a non-visited, disabled state. | 
| java.awt.Color | getHoverColor()Returns the color of the link in a hover, non-visited, non-active, non-disabled state. | 
| boolean | getHoverUnderline()Returns wheter or not to underline the link in a hover, non-visited, non-active,
 non-disabled state. | 
| java.awt.Color | getLinkColor()Returns the color of the link in a non-hover, non-visited, non-active, non-disabled state. | 
| boolean | getLinkUnderline()Returns wheter or not to underline the link in a non-hover, non-visited, non-active,
 non-disabled state. | 
| java.awt.Color | getVisitedColor()Returns the color of the link in a non-hover, visited, non-active, non-disabled state. | 
| java.awt.Color | getVisitedDisabledColor()Returns the color of the link in a visited, disabled state. | 
| boolean | getVisitedDisabledUnderline()Returns wheter or not to underline the link in a visited, disabled state. | 
| java.awt.Color | getVisitedHoverColor()Returns the color of the link in a hover, visited, non-active, non-disabled state. | 
| boolean | getVisitedHoverUnderline()Returns wheter or not to underline the link in a hover, visited, non-active,
 non-disabled state. | 
| boolean | getVisitedUnderline()Returns wheter or not to underline the link in a non-hover, visited, non-active,
 non-disabled state. | 
| void | initHyperlink()Called by the constructors to initialize the hyperlink. | 
| void | setActiveColor(java.awt.Color color)Sets the color of the link in an active, non-disabled state. | 
| void | setActiveUnderline(boolean underline)Sets wheter or not to underline the link in an active, non-disabled state. | 
| void | setDisabledColor(java.awt.Color color)Sets the color of the link in a non-visited, disabled state. | 
| void | setDisabledIcon(javax.swing.Icon icon)Intercept setDisabledIcon() calls to propagate the changes to the label. | 
| void | setDisabledSelectedIcon(javax.swing.Icon icon)Intercept setDisabledSelectedIcon() calls to propagate the changes to the label. | 
| void | setDisabledUnderline(boolean underline)Sets wheter or not to underline the link in a non-visited, disabled state. | 
| void | setEnabled(boolean enabled)Intercept setEnabled() calls to propagate the changes to the label. | 
| void | setHoverColor(java.awt.Color color)Sets the color of the link in a hover, non-visited, non-active, non-disabled state. | 
| void | setHoverUnderline(boolean underline)Sets wheter or not to underline the link in a hover, non-visited, non-active,
 non-disabled state. | 
| void | setIcon(javax.swing.Icon icon)Intercept setIcon() calls to propagate the changes to the label. | 
| void | setLinkColor(java.awt.Color color)Sets the color of the link in a non-hover, non-visited, non-active, non-disabled state. | 
| void | setLinkUnderline(boolean underline)Sets wheter or not to underline the link in a non-hover, non-visited, non-active,
 non-disabled state. | 
| void | setModel(javax.swing.ButtonModel model)Intercept setModel() calls to keep a listener on the model. | 
| void | setPressedIcon(javax.swing.Icon icon)Intercept setPressedIcon() calls to propagate the changes to the label. | 
| void | setRolloverIcon(javax.swing.Icon icon)Intercept setRolloverIcon() calls to propagate the changes to the label. | 
| void | setRolloverSelectedIcon(javax.swing.Icon icon)Intercept setRolloverSelectedIcon() calls to propagate the changes to the label. | 
| void | setSelectedIcon(javax.swing.Icon icon)Intercept setSelectedIcon() calls to propagate the changes to the label. | 
| void | setText(java.lang.String text)Intercept setText() calls to propagate the changes to the label. | 
| void | setVisitedColor(java.awt.Color color)Sets the color of the link in a non-hover, visited, non-active, non-disabled state. | 
| void | setVisitedDisabledColor(java.awt.Color color)Sets the color of the link in a visited, disabled state. | 
| void | setVisitedDisabledUnderline(boolean underline)Sets wheter or not to underline the link in a visited, disabled state. | 
| void | setVisitedHoverColor(java.awt.Color color)Sets the color of the link in a hover, visited, non-active, non-disabled state. | 
| void | setVisitedHoverUnderline(boolean underline)Sets wheter or not to underline the link in a hover, visited, non-active,
 non-disabled state. | 
| void | setVisitedUnderline(boolean underline)Sets wheter or not to underline the link in a non-hover, visited, non-active,
 non-disabled state. | 
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, paramString, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setRolloverEnabled, setSelected, setUI, setVerticalAlignment, setVerticalTextPosition, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final byte CLASSIC_STYLE
public static final byte CLASSIC_HOVER_STYLE
public static final byte BLUE_STYLE
public static final byte METAL_STYLE
public PHyperlink()
public PHyperlink(java.lang.String text)
public PHyperlink(java.lang.String text,
          javax.swing.Icon icon)
public PHyperlink(java.lang.String text,
          javax.swing.Icon icon,
          byte style)
public PHyperlink(javax.swing.Action a)
public PHyperlink(javax.swing.Action a,
          byte style)
public PHyperlink(java.lang.String text,
          javax.swing.Icon icon,
          java.awt.Color linkColor,
          boolean linkUnderline,
          java.awt.Color hoverColor,
          boolean hoverUnderline,
          java.awt.Color disabledColor,
          boolean disabledUnderline,
          java.awt.Color visitedColor,
          boolean visitedUnderline,
          java.awt.Color visitedHoverColor,
          boolean visitedHoverUnderline,
          java.awt.Color visitedDisabledColor,
          boolean visitedDisabledUnderline,
          java.awt.Color activeColor,
          boolean activeUnderline)
public void initHyperlink()
public void setModel(javax.swing.ButtonModel model)
setModel in class javax.swing.AbstractButtonpublic void setEnabled(boolean enabled)
setEnabled in class javax.swing.AbstractButtonpublic void setText(java.lang.String text)
setText in class javax.swing.AbstractButtonpublic void setPressedIcon(javax.swing.Icon icon)
setPressedIcon in class javax.swing.AbstractButtonpublic void setIcon(javax.swing.Icon icon)
setIcon in class javax.swing.AbstractButtonpublic void setSelectedIcon(javax.swing.Icon icon)
setSelectedIcon in class javax.swing.AbstractButtonpublic void setRolloverIcon(javax.swing.Icon icon)
setRolloverIcon in class javax.swing.AbstractButtonpublic void setRolloverSelectedIcon(javax.swing.Icon icon)
setRolloverSelectedIcon in class javax.swing.AbstractButtonpublic void setDisabledIcon(javax.swing.Icon icon)
setDisabledIcon in class javax.swing.AbstractButtonpublic void setDisabledSelectedIcon(javax.swing.Icon icon)
setDisabledSelectedIcon in class javax.swing.AbstractButtonpublic void setLinkColor(java.awt.Color color)
color - The new color of a the link in a non-hover, non-visited, non-active,
 non-disabled state.public java.awt.Color getLinkColor()
public void setLinkUnderline(boolean underline)
underline - Wheter or not to underline the link in a non-hover, non-visited,
 non-active, non-disabled state.public boolean getLinkUnderline()
public void setHoverColor(java.awt.Color color)
color - The new color of a the link in a hover, non-visited, non-active,
 non-disabled state.public java.awt.Color getHoverColor()
public void setHoverUnderline(boolean underline)
underline - Wheter or not to underline the link in a hover, non-visited,
 non-active, non-disabled state.public boolean getHoverUnderline()
public void setDisabledColor(java.awt.Color color)
color - The new color of a the link in a non-visited, disabled state.public java.awt.Color getDisabledColor()
public void setDisabledUnderline(boolean underline)
underline - Wheter or not to underline the link in a non-visited, disabled state.public boolean getDisabledUnderline()
public void setVisitedColor(java.awt.Color color)
color - The new color of a the link in a non-hover, visited, non-active,
 non-disabled state.public java.awt.Color getVisitedColor()
public void setVisitedUnderline(boolean underline)
underline - Wheter or not to underline the link in a non-hover, visited,
 non-active, non-disabled state.public boolean getVisitedUnderline()
public void setVisitedHoverColor(java.awt.Color color)
color - The new color of a the link in a hover, visited, non-active,
 non-disabled state.public java.awt.Color getVisitedHoverColor()
public void setVisitedHoverUnderline(boolean underline)
underline - Wheter or not to underline the link in a hover, visited,
 non-active, non-disabled state.public boolean getVisitedHoverUnderline()
public void setVisitedDisabledColor(java.awt.Color color)
color - The new color of a the link in a visited, disabled state.public java.awt.Color getVisitedDisabledColor()
public void setVisitedDisabledUnderline(boolean underline)
underline - Wheter or not to underline the link in a visited, disabled state.public boolean getVisitedDisabledUnderline()
public void setActiveColor(java.awt.Color color)
color - The new color of a the link in an active, non-disabled state.public java.awt.Color getActiveColor()
public void setActiveUnderline(boolean underline)
underline - Wheter or not to underline the link in an active, non-disabled state.public boolean getActiveUnderline()