Top Fields Constructors Methods
org.apache.pdfbox.debugger.hexviewer

pack-priv Class AddressPane

extends JComponent
Class Inheritance
Imports
java.awt.Color, .Dimension, .Graphics, .Graphics2D, .Rectangle, javax.swing.JComponent

Author
Khyrul Bashar This class shows the address of the currently selected byte.

Field Summary

Modifier and TypeField and Description
private int
private int
private final 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
AddressPane(int
int. Total line number needed to show all the bytes.
total
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
protected void
paintComponent(Graphics
the Graphics object to protect
g
)

Overrides javax.swing.JComponent.paintComponent.

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

private void
paintSelected(Graphics
Graphics instance.
g
,
int
int. x axis value.
x
,
int
int. y axis value.
y
)

Paint a selected line

pack-priv void
setSelected(int
int.
index
)

Updates the line text (index in hexadecimal) for a given index.

Inherited from javax.swing.JComponent:
addAncestorListeneraddNotifyaddVetoableChangeListenercomputeVisibleRectcontainscreateToolTipdisableenablefirePropertyChangefirePropertyChangefirePropertyChangefireVetoableChangegetActionForKeyStrokegetActionMapgetAlignmentXgetAlignmentYgetAncestorListenersgetAutoscrollsgetBaselinegetBaselineResizeBehaviorgetBordergetBoundsgetClientPropertygetComponentGraphicsgetComponentPopupMenugetConditionForKeyStrokegetDebugGraphicsOptionsgetDefaultLocalegetFontMetricsgetGraphicsgetHeightgetInheritsPopupMenugetInputMapgetInputMapgetInputVerifiergetInsetsgetInsetsgetListenersgetLocationgetMaximumSizegetMinimumSizegetNextFocusableComponentgetPopupLocationgetPreferredSizegetRegisteredKeyStrokesgetRootPanegetSizegetToolTipLocationgetToolTipTextgetToolTipTextgetTopLevelAncestorgetTransferHandlergetUIgetUIClassIDgetVerifyInputWhenFocusTargetgetVetoableChangeListenersgetVisibleRectgetWidthgetXgetYgrabFocushideisDoubleBufferedisLightweightComponentisManagingFocusisOpaqueisOptimizedDrawingEnabledisPaintingForPrintisPaintingOriginisPaintingTileisRequestFocusEnabledisValidateRootpaintpaintBorderpaintChildrenpaintImmediatelypaintImmediatelyparamStringprintprintAllprintBorderprintChildrenprintComponentprocessComponentKeyEventprocessKeyBindingprocessKeyEventprocessMouseEventprocessMouseMotionEventputClientPropertyregisterKeyboardActionregisterKeyboardActionremoveAncestorListenerremoveNotifyremoveVetoableChangeListenerrepaintrepaintrequestDefaultFocusrequestFocusrequestFocusrequestFocusInWindowrequestFocusInWindowresetKeyboardActionsreshaperevalidatescrollRectToVisiblesetActionMapsetAlignmentXsetAlignmentYsetAutoscrollssetBackgroundsetBordersetComponentPopupMenusetDebugGraphicsOptionssetDefaultLocalesetDoubleBufferedsetEnabledsetFocusTraversalKeyssetFontsetForegroundsetInheritsPopupMenusetInputMapsetInputVerifiersetMaximumSizesetMinimumSizesetNextFocusableComponentsetOpaquesetPreferredSizesetRequestFocusEnabledsetToolTipTextsetTransferHandlersetUIsetVerifyInputWhenFocusTargetsetVisibleunregisterKeyboardActionupdateupdateUI

Field Detail

selectedIndexback to summary
private int selectedIndex
selectedLineback to summary
private int selectedLine
totalLineback to summary
private final int totalLine

Constructor Detail

AddressPaneback to summary
pack-priv AddressPane(int total)

Constructor.

Parameters
total:int

int. Total line number needed to show all the bytes.

Method Detail

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.

Parameters
g:Graphics

the Graphics object to protect

Annotations
@Override
paintSelectedback to summary
private void paintSelected(Graphics g, int x, int y)

Paint a selected line

Parameters
g:Graphics

Graphics instance.

x:int

int. x axis value.

y:int

int. y axis value.

setSelectedback to summary
pack-priv void setSelected(int index)

Updates the line text (index in hexadecimal) for a given index. It is used when a byte is selected in hex pane.

Parameters
index:int

int.