org.brains2b.thex
Class ViewHex

java.lang.Object
  extended by javax.swing.text.View
      extended by org.brains2b.thex.ViewHex
All Implemented Interfaces:
javax.swing.SwingConstants

public class ViewHex
extends javax.swing.text.View

View to paint the content of a JTextComponent to draw the content of a BinaryDocument as a Hex encoded bytes

This View is linked with BinaryEditor

Version:
$Revision: 1.9 $ $Date: 2010/01/15 03:53:05 $
Author:
dennis@brains2b.nl

Field Summary
 
Fields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
 
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
 
Constructor Summary
ViewHex(javax.swing.text.Element element)
          Constructor
 
Method Summary
 void calculateMetrics(java.awt.Graphics g)
          calculate the metrics for the font used to paint this View
 void changedUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
          
 float getPreferredSpan(int axis)
          
 void insertUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
          
 java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b)
          
 void paint(java.awt.Graphics g, java.awt.Shape allocation)
          
 void removeUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
          
 int viewToModel(float x, float y, java.awt.Shape a, javax.swing.text.Position.Bias[] biasReturn)
          
 
Methods inherited from class javax.swing.text.View
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, setSize, updateChildren, updateLayout, viewToModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewHex

public ViewHex(javax.swing.text.Element element)
Constructor

Parameters:
element - Element, the element to create the view for.
Method Detail

getPreferredSpan

public float getPreferredSpan(int axis)

Specified by:
getPreferredSpan in class javax.swing.text.View

modelToView

public java.awt.Shape modelToView(int pos,
                                  java.awt.Shape a,
                                  javax.swing.text.Position.Bias b)
                           throws javax.swing.text.BadLocationException

Specified by:
modelToView in class javax.swing.text.View
Throws:
javax.swing.text.BadLocationException

paint

public void paint(java.awt.Graphics g,
                  java.awt.Shape allocation)

Specified by:
paint in class javax.swing.text.View

viewToModel

public int viewToModel(float x,
                       float y,
                       java.awt.Shape a,
                       javax.swing.text.Position.Bias[] biasReturn)

Specified by:
viewToModel in class javax.swing.text.View

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e,
                         java.awt.Shape a,
                         javax.swing.text.ViewFactory f)

Overrides:
insertUpdate in class javax.swing.text.View

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e,
                         java.awt.Shape a,
                         javax.swing.text.ViewFactory f)

Overrides:
removeUpdate in class javax.swing.text.View

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e,
                          java.awt.Shape a,
                          javax.swing.text.ViewFactory f)

Overrides:
changedUpdate in class javax.swing.text.View

calculateMetrics

public void calculateMetrics(java.awt.Graphics g)
calculate the metrics for the font used to paint this View

Parameters:
g - Graphics