|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.text.View
javax.swing.text.PlainView
edu.rice.cs.drjava.model.definitions.ColoringView
public class ColoringView
This view class renders text on the screen using the reduced model info. By extending WrappedPlainView, we only have to override the parts we want to. Here we only override drawUnselectedText. We may want to override drawSelectedText at some point. As of 2002/06/17, we now extend PlainView because WrappedPlainView was causing bugs related to resizing the viewport of the definitions scroll pane.
| Nested Class Summary | |
|---|---|
private class |
ColoringView.ColorOptionListener
The OptionListeners for DEFINITIONS COLORs |
private static class |
ColoringView.FontOptionListener
|
| Field Summary | |
|---|---|
static java.awt.Color |
COMMENTED_COLOR
|
static java.awt.Color |
DEBUGGER_COLOR
|
static java.awt.Color |
DOUBLE_QUOTED_COLOR
|
static java.awt.Color |
ERROR_COLOR
|
static java.awt.Color |
INTERACTIONS_SYSTEM_ERR_COLOR
|
static java.awt.Color |
INTERACTIONS_SYSTEM_IN_COLOR
|
static java.awt.Color |
INTERACTIONS_SYSTEM_OUT_COLOR
|
static java.awt.Color |
KEYWORD_COLOR
|
static java.awt.Font |
MAIN_FONT
|
static java.awt.Color |
NORMAL_COLOR
|
static java.awt.Color |
NUMBER_COLOR
|
static java.awt.Color |
SINGLE_QUOTED_COLOR
|
static java.awt.Color |
TYPE_COLOR
|
| 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 | |
|---|---|
ColoringView(javax.swing.text.Element elem)
Constructs a new coloring view. |
|
| Method Summary | |
|---|---|
void |
changedUpdate(javax.swing.event.DocumentEvent changes,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
Called when a change occurs. |
protected int |
drawSelectedText(java.awt.Graphics g,
int x,
int y,
int start,
int end)
Draws the selected text image at the specified location. |
protected int |
drawUnselectedText(java.awt.Graphics g,
int x,
int y,
int start,
int end)
Renders the given range in the model as normal unselected text. |
private void |
repaintContainer()
Repaints the container associated with this view, if such container exists. |
private void |
setFormattingForState(java.awt.Graphics g,
int state)
Given a particular state, assign it a color. |
void |
updateColors()
Called when an OptionListener perceives a change in any of the colors |
| Methods inherited from class javax.swing.text.PlainView |
|---|
damageLineRange, drawLine, getLineBuffer, getPreferredSpan, getTabSize, insertUpdate, lineToRect, modelToView, nextTabStop, paint, removeUpdate, setSize, updateDamage, updateMetrics, viewToModel |
| 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, updateChildren, updateLayout, viewToModel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.awt.Color COMMENTED_COLOR
public static java.awt.Color DOUBLE_QUOTED_COLOR
public static java.awt.Color SINGLE_QUOTED_COLOR
public static java.awt.Color NORMAL_COLOR
public static java.awt.Color KEYWORD_COLOR
public static java.awt.Color NUMBER_COLOR
public static java.awt.Color TYPE_COLOR
public static java.awt.Font MAIN_FONT
public static java.awt.Color INTERACTIONS_SYSTEM_ERR_COLOR
public static java.awt.Color INTERACTIONS_SYSTEM_IN_COLOR
public static java.awt.Color INTERACTIONS_SYSTEM_OUT_COLOR
public static java.awt.Color ERROR_COLOR
public static java.awt.Color DEBUGGER_COLOR
| Constructor Detail |
|---|
public ColoringView(javax.swing.text.Element elem)
elem - the element| Method Detail |
|---|
protected int drawUnselectedText(java.awt.Graphics g,
int x,
int y,
int start,
int end)
throws javax.swing.text.BadLocationException
drawUnselectedText in class javax.swing.text.PlainViewg - The graphics contextx - The starting X coordinatey - The starting Y coordinatestart - The beginning position in the modelend - The ending position in the model
javax.swing.text.BadLocationException - If the range is invalid
protected int drawSelectedText(java.awt.Graphics g,
int x,
int y,
int start,
int end)
throws javax.swing.text.BadLocationException
drawSelectedText in class javax.swing.text.PlainViewg - The text imagex - The x coordinate for the drawn texty - The y coordinate for the drawn textstart - The beginning position in the modelend - The end position in the model
javax.swing.text.BadLocationException
private void setFormattingForState(java.awt.Graphics g,
int state)
g - Graphics objectstate - a given stateprivate void repaintContainer()
public void changedUpdate(javax.swing.event.DocumentEvent changes,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
changedUpdate in class javax.swing.text.PlainViewchanges - document changesa - a Shapef - a ViewFactorypublic void updateColors()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||