Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

allensoft.javacvs.client.ui.swing
Class AnnotatedEditorKit.AnnotatedView  view AnnotatedEditorKit.AnnotatedView download AnnotatedEditorKit.AnnotatedView.java

java.lang.Object
  extended byjavax.swing.text.View
      extended byjavax.swing.text.PlainView
          extended byallensoft.javacvs.client.ui.swing.AnnotatedEditorKit.AnnotatedView
All Implemented Interfaces:
javax.swing.SwingConstants, javax.swing.text.TabExpander
Enclosing class:
AnnotatedEditorKit

public static class AnnotatedEditorKit.AnnotatedView
extends javax.swing.text.PlainView

View which displays the annotations. It fills alternating colors around the annotations to separate them and displays line numbers and authour and revision for the first line of a new annotation.


Nested Class Summary
private static class AnnotatedEditorKit.AnnotatedView.Annotation
           
 
Field Summary
private static java.awt.Color[] g_Colors
           
private  AnnotatedEditorKit.AnnotatedView.Annotation[] m_Annotations
           
private  int m_nMargin
           
private  int m_nMaxAuthorWidth
           
private  int m_nMaxLineNumberWidth
           
private  int m_nMaxRevisionWidth
           
private  boolean[] m_ShowAnnotations
           
 
Fields inherited from class javax.swing.text.PlainView
metrics
 
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
AnnotatedEditorKit.AnnotatedView(javax.swing.text.Element element)
           
 
Method Summary
protected  void calculateMargins()
           
protected  void drawLine(int lineIndex, java.awt.Graphics g, int x, int y)
          Draws a line of text.
 float getMaximumSpan(int axis)
          Returns the maximum span along the specified axis.
 float getMinimumSpan(int axis)
          Returns the minimum span along the specified axis.
 float getPreferredSpan(int axis)
          Returns the preferred span along the specified axis.
 java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b)
          Maps a position in the document into the coordinate space of the View.
 void paint(java.awt.Graphics g, java.awt.Shape a)
           
protected  void updateMetrics()
           
 int viewToModel(float fx, float fy, java.awt.Shape a, javax.swing.text.Position.Bias[] bias)
          Maps coordinates from the View's space into a position in the document model.
 
Methods inherited from class javax.swing.text.PlainView
changedUpdate, damageLineRange, drawSelectedText, drawUnselectedText, getLineBuffer, getTabSize, insertUpdate, lineToRect, nextTabStop, removeUpdate, updateDamage
 
Methods inherited from class javax.swing.text.View
append, breakView, createFragment, dump, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, 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
 

Field Detail

m_ShowAnnotations

private boolean[] m_ShowAnnotations

m_Annotations

private AnnotatedEditorKit.AnnotatedView.Annotation[] m_Annotations

g_Colors

private static java.awt.Color[] g_Colors

m_nMaxLineNumberWidth

private int m_nMaxLineNumberWidth

m_nMaxAuthorWidth

private int m_nMaxAuthorWidth

m_nMaxRevisionWidth

private int m_nMaxRevisionWidth

m_nMargin

private int m_nMargin
Constructor Detail

AnnotatedEditorKit.AnnotatedView

public AnnotatedEditorKit.AnnotatedView(javax.swing.text.Element element)
Method Detail

updateMetrics

protected void updateMetrics()

calculateMargins

protected void calculateMargins()

drawLine

protected void drawLine(int lineIndex,
                        java.awt.Graphics g,
                        int x,
                        int y)
Description copied from class: javax.swing.text.PlainView
Draws a line of text. The X and Y coordinates specify the start of the baseline of the line.


paint

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

modelToView

public java.awt.Shape modelToView(int pos,
                                  java.awt.Shape a,
                                  javax.swing.text.Position.Bias b)
                           throws javax.swing.text.BadLocationException
Description copied from class: javax.swing.text.View
Maps a position in the document into the coordinate space of the View. The output rectangle usually reflects the font height but has a width of zero.


viewToModel

public int viewToModel(float fx,
                       float fy,
                       java.awt.Shape a,
                       javax.swing.text.Position.Bias[] bias)
Description copied from class: javax.swing.text.PlainView
Maps coordinates from the View's space into a position in the document model.


getPreferredSpan

public float getPreferredSpan(int axis)
Description copied from class: javax.swing.text.View
Returns the preferred span along the specified axis. Normally the view is rendered with the span returned here if that is possible.


getMinimumSpan

public float getMinimumSpan(int axis)
Description copied from class: javax.swing.text.View
Returns the minimum span along the specified axis. The default implementation will forward to View.getPreferredSpan(int)>View.getPreferredSpan(int) 55 unless View.getResizeWeight(int)>View.getResizeWeight(int) 55 returns a value > 0, in which case this returns 0.


getMaximumSpan

public float getMaximumSpan(int axis)
Description copied from class: javax.swing.text.View
Returns the maximum span along the specified axis. The default implementation will forward to View.getPreferredSpan(int)>View.getPreferredSpan(int) 55 unless View.getResizeWeight(int)>View.getResizeWeight(int) 55 returns a value > 0, in which case this returns Integer.MIN_VALUE>Integer.MIN_VALUE 55 .