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

pack-priv Class ASCIIPane

extends JComponent
implements HexModelChangeListener
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.debugger.hexviewer.HexModelChangeListener
Annotations
@SuppressWarnings:serial, squid:S1948
Imports
java.awt.Color, .Dimension, .Graphics, .Graphics2D, .Rectangle, javax.swing.JComponent

Author
Khyrul Bashar This class shows corresponding ASCII characters for bytes. For every 16 byte there is one line. This paints the only visible contents at one time.

Field Summary

Modifier and TypeField and Description
private final HexModel
private int
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
ASCIIPane(HexModel
HexModel instance.
model
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
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
paintInSelected(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 for a given index.

Inherited from javax.swing.JComponent:
addAncestorListeneraddNotifyaddVetoableChangeListenercomputeVisibleRectcontainscreateToolTipdisableenablefirePropertyChangefirePropertyChangefirePropertyChangefireVetoableChangegetActionForKeyStrokegetActionMapgetAlignmentXgetAlignmentYgetAncestorListenersgetAutoscrollsgetBaselinegetBaselineResizeBehaviorgetBordergetBoundsgetClientPropertygetComponentGraphicsgetComponentPopupMenugetConditionForKeyStrokegetDebugGraphicsOptionsgetDefaultLocalegetFontMetricsgetGraphicsgetHeightgetInheritsPopupMenugetInputMapgetInputMapgetInputVerifiergetInsetsgetInsetsgetListenersgetLocationgetMaximumSizegetMinimumSizegetNextFocusableComponentgetPopupLocationgetPreferredSizegetRegisteredKeyStrokesgetRootPanegetSizegetToolTipLocationgetToolTipTextgetToolTipTextgetTopLevelAncestorgetTransferHandlergetUIgetUIClassIDgetVerifyInputWhenFocusTargetgetVetoableChangeListenersgetVisibleRectgetWidthgetXgetYgrabFocushideisDoubleBufferedisLightweightComponentisManagingFocusisOpaqueisOptimizedDrawingEnabledisPaintingForPrintisPaintingOriginisPaintingTileisRequestFocusEnabledisValidateRootpaintpaintBorderpaintChildrenpaintImmediatelypaintImmediatelyparamStringprintprintAllprintBorderprintChildrenprintComponentprocessComponentKeyEventprocessKeyBindingprocessKeyEventprocessMouseEventprocessMouseMotionEventputClientPropertyregisterKeyboardActionregisterKeyboardActionremoveAncestorListenerremoveNotifyremoveVetoableChangeListenerrepaintrepaintrequestDefaultFocusrequestFocusrequestFocusrequestFocusInWindowrequestFocusInWindowresetKeyboardActionsreshaperevalidatescrollRectToVisiblesetActionMapsetAlignmentXsetAlignmentYsetAutoscrollssetBackgroundsetBordersetComponentPopupMenusetDebugGraphicsOptionssetDefaultLocalesetDoubleBufferedsetEnabledsetFocusTraversalKeyssetFontsetForegroundsetInheritsPopupMenusetInputMapsetInputVerifiersetMaximumSizesetMinimumSizesetNextFocusableComponentsetOpaquesetPreferredSizesetRequestFocusEnabledsetToolTipTextsetTransferHandlersetUIsetVerifyInputWhenFocusTargetsetVisibleunregisterKeyboardActionupdateupdateUI

Field Detail

modelback to summary
private final HexModel model
selectedIndexInLineback to summary
private int selectedIndexInLine
selectedLineback to summary
private int selectedLine

Constructor Detail

ASCIIPaneback to summary
pack-priv ASCIIPane(HexModel model)

Constructor.

Parameters
model:HexModel

HexModel instance.

Method Detail

hexModelChangedback to summary
public void hexModelChanged(HexModelChangedEvent event)

Implements org.apache.pdfbox.debugger.hexviewer.HexModelChangeListener.hexModelChanged.

Annotations
@Override
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
paintInSelectedback to summary
private void paintInSelected(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 for a given index. It is used when a byte is selected in hex pane.

Parameters
index:int

int.