|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.text.JTextComponent
|
+--javax.swing.JTextField
|
+--arlut.csd.JDataComponent.JentryField
|
+--arlut.csd.JDataComponent.JIPField
This class is an IPv4/IPv6 data display/entry widget for Ganymede. Its purpose
is to allow the viewing and editing of either 4 or 16 byte Internet addresses
and subnet masks.
Note that wherever Ganymede manipulates IP addresses, it does so in terms
of unsigned bytes. Since Java does not provide an unsigned byte type, Ganymede
uses the s2u() and u2s() static methods defined in this class to convert from
the signed Java byte to the Ganymede 0-255 IP octet range.
| Field Summary | |
private boolean |
allowV6
|
static boolean |
debug
|
static int |
DEFAULT_COLS
|
private static java.lang.String |
IPv4allowedChars
|
private static java.lang.String |
IPv6allowedChars
|
private boolean |
processingCallback
|
private java.lang.String |
storedValue
|
| Fields inherited from class arlut.csd.JDataComponent.JentryField |
allowCallback, my_parent, notifier |
| Fields inherited from class javax.swing.JTextField |
notifyAction |
| Fields inherited from class javax.swing.text.JTextComponent |
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JIPField(boolean allowV6)
Constructor which uses default fonts,no parent, default column size, and default foregound/background colors. |
|
JIPField(boolean is_editable,
boolean allowV6)
Base constructor for JIPField |
|
JIPField(boolean is_editable,
arlut.csd.JDataComponent.JsetValueCallback callback,
boolean allowV6)
Constructor that allows for the creation of a JIPField that knows about its parent. |
|
| Method Summary | |
static java.lang.Byte[] |
genIPV4bytes(java.lang.String input)
This method takes an IPv4 string in standard format and generates an array of 4 bytes that the Ganymede server can accept. |
static java.lang.String |
genIPV4string(java.lang.Byte[] octets)
This method generates a standard string representation of an IPv4 address from an array of 4 octets. |
static java.lang.Byte[] |
genIPV6bytes(java.lang.String input)
This method takes an IPv6 string in any of the standard RFC 1884 formats or a standard IPv4 string and generates an array of 16 bytes that the Ganymede server can accept as an IPv6 address. |
static java.lang.String |
genIPV6string(java.lang.Byte[] octets)
This method takes an array of 4 or 16 bytes and generates an optimal RFC 1884 string encoding suitable for display. |
char |
getCharAt(int n)
returns the character located at position n in the JIPField value |
java.lang.Byte[] |
getValue()
Returns the current IP value held in this JIPField. |
private static boolean |
isAllowedV4(char ch)
determines whether a given character is valid or invalid for a JIPField |
private static boolean |
isAllowedV6(char ch)
determines whether a given character is valid or invalid for a JIPField |
static void |
main(java.lang.String[] argv)
|
private void |
reportError(java.lang.String error)
This private method is used to report an error condition to the user. |
static short |
s2u(byte b)
This method maps a u2s-encoded signed byte value to an int value between 0 and 255 inclusive. |
int |
sendCallback()
When the JIPField looses focus, any changes made to the value in the JIPField need to be propogated to the server. |
void |
setValue(java.lang.Byte[] bytes)
Sets the IP value held in this JIPField, without triggering a callback update. |
static byte |
u2s(int x)
This method maps an int value between 0 and 255 inclusive to a legal signed byte value. |
| Methods inherited from class arlut.csd.JDataComponent.JentryField |
actionPerformed, focusGained, focusLost, getLength, getMaxStringSize, isAllowed, setCallback, setEnterHandler |
| Methods inherited from class javax.swing.JTextField |
addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setHorizontalAlignment, setScrollOffset |
| Methods inherited from class javax.swing.text.JTextComponent |
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final boolean debug
public static int DEFAULT_COLS
private static java.lang.String IPv4allowedChars
private static java.lang.String IPv6allowedChars
private java.lang.String storedValue
private boolean allowV6
private boolean processingCallback
| Constructor Detail |
public JIPField(boolean is_editable,
boolean allowV6)
is_editable - true if this JIPField is editablepublic JIPField(boolean allowV6)
public JIPField(boolean is_editable,
arlut.csd.JDataComponent.JsetValueCallback callback,
boolean allowV6)
| Method Detail |
public char getCharAt(int n)
n - position in the JIPField value from which to retrieve characterpublic void setValue(java.lang.Byte[] bytes)
bytes - IP v4 or v6 address in byte array formpublic java.lang.Byte[] getValue()
public int sendCallback()
sendCallback in class JentryFieldprivate void reportError(java.lang.String error)
public static final byte u2s(int x)
public static final short s2u(byte b)
private static final boolean isAllowedV4(char ch)
ch - the character which is being tested for its validityprivate static final boolean isAllowedV6(char ch)
ch - the character which is being tested for its validitypublic static java.lang.Byte[] genIPV4bytes(java.lang.String input)
public static java.lang.String genIPV4string(java.lang.Byte[] octets)
public static java.lang.Byte[] genIPV6bytes(java.lang.String input)
public static java.lang.String genIPV6string(java.lang.Byte[] octets)
public static void main(java.lang.String[] argv)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||