APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.jvm.hotspot.ui

public Class SourceCodePanel

extends JPanel
Class Inheritance
Imports
java.awt.*, java.awt.event.*, java.awt.geom.Rectangle2D, java.io.*, java.net.*, java.util.*, javax.swing.*, javax.swing.text.BadLocationException

Panel supporting loading of and scrolling through source code. Contains convenience routines for implementing the Editor interface.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
SourceCodePanel.RowHeader

Support for displaying icons and line numbers in row header of scroll pane

Field Summary

Modifier and TypeField and Description
private static Icon
private Set<Integer>
private EditorCommands
private String
private SourceCodePanel.RowHeader
private int
private static final int
private static final int
private static Icon
private Editor
private JTextArea
private static Icon

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public int
getCurrentLineNumber()

Line number is one-based

public boolean
public String
public boolean
hasBreakpointAtLine(int lineNo)

public void
highlightLineNumber(int lineNo)

Line number is one-based

private Icon
private void
public boolean
openFile(String filename)

public void
requestFocus()

Overrides javax.swing.JComponent.requestFocus.

Requests that this Component gets the input focus.

public void
public void
setFont(Font f)

Overrides javax.swing.JComponent.setFont.

Sets the font for this component.

public void
setShowLineNumbers(boolean val)

public void
public void
showLineNumber(int lineNo)

Line number is one-based

Inherited from javax.swing.JPanel:
getAccessibleContextgetUIgetUIClassIDparamStringsetUIupdateUI

Field Detail

breakpointback to summary
private static Icon breakpoint
breakpointsback to summary
private Set<Integer> breakpoints
commback to summary
private EditorCommands comm
filenameback to summary
private String filename
highlightedLineback to summary
private int highlightedLine
ICON_SIZEback to summary
private static final int ICON_SIZE
LINE_NO_SPACEback to summary
private static final int LINE_NO_SPACE
lowerFrameCurLineback to summary
private static Icon lowerFrameCurLine
parentback to summary
private Editor parent

Hides java.awt.Component.parent.

sourceback to summary
private JTextArea source
topFrameCurLineback to summary
private static Icon topFrameCurLine

Constructor Detail

SourceCodePanelback to summary
public SourceCodePanel()

Method Detail

clearBreakpointAtLineback to summary
public void clearBreakpointAtLine(int lineNo)
clearBreakpointsback to summary
public void clearBreakpoints()
getCurrentLineNumberback to summary
public int getCurrentLineNumber()

Line number is one-based

getShowLineNumbersback to summary
public boolean getShowLineNumbers()
getSourceFileNameback to summary
public String getSourceFileName()
hasBreakpointAtLineback to summary
public boolean hasBreakpointAtLine(int lineNo)
highlightLineNumberback to summary
public void highlightLineNumber(int lineNo)

Line number is one-based

loadIconback to summary
private Icon loadIcon(String which)
maybeLoadIconsback to summary
private void maybeLoadIcons()
openFileback to summary
public boolean openFile(String filename)
requestFocusback to summary
public void requestFocus()

Overrides javax.swing.JComponent.requestFocus.

Doc from javax.swing.JComponent.requestFocus.

Requests that this Component gets the input focus. Refer to Component.requestFocus() for a complete description of this method.

Note that the use of this method is discouraged because its behavior is platform dependent. Instead we recommend the use of requestFocusInWindow(). If you would like more information on focus, see How to Use the Focus Subsystem, a section in The Java Tutorial.

setEditorCommandsback to summary
public void setEditorCommands(EditorCommands comm, Editor parent)
setFontback to summary
public void setFont(Font f)

Overrides javax.swing.JComponent.setFont.

Doc from javax.swing.JComponent.setFont.

Sets the font for this component.

setShowLineNumbersback to summary
public void setShowLineNumbers(boolean val)
showBreakpointAtLineback to summary
public void showBreakpointAtLine(int lineNo)
showLineNumberback to summary
public void showLineNumber(int lineNo)

Line number is one-based

sun.jvm.hotspot.ui back to summary

pack-priv Class SourceCodePanel.RowHeader

extends JPanel
Class Inheritance

Support for displaying icons and line numbers in row header of scroll pane

Field Summary

Modifier and TypeField and Description
private boolean
private int
private boolean
private JViewport
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
paint(Graphics g)

Overrides javax.swing.JComponent.paint.

Invoked by Swing to draw components.

pack-priv void
public void
setFont(Font f)

Overrides javax.swing.JComponent.setFont.

Sets the font for this component.

public void
setShowLineNumbers(boolean val)

pack-priv void
Inherited from javax.swing.JPanel:
getAccessibleContextgetUIgetUIClassIDparamStringsetUIupdateUI

Field Detail

inittedback to summary
private boolean initted
rowHeightback to summary
private int rowHeight
showLineNumbersback to summary
private boolean showLineNumbers
viewback to summary
private JViewport view
widthback to summary
private int width

Hides java.awt.Component.width.

Constructor Detail

RowHeaderback to summary
public RowHeader()

Method Detail

getShowLineNumbersback to summary
public boolean getShowLineNumbers()
paintback to summary
public void paint(Graphics g)

Overrides javax.swing.JComponent.paint.

Doc from javax.swing.JComponent.paint.

Invoked by Swing to draw components. Applications should not invoke paint directly, but should instead use the repaint method to schedule the component for redrawing.

This method actually delegates the work of painting to three protected methods: paintComponent, paintBorder, and paintChildren. They're called in the order listed to ensure that children appear on top of component itself. Generally speaking, the component and its children should not paint in the insets area allocated to the border. Subclasses can just override this method, as always. A subclass that just wants to specialize the UI (look and feel) delegate's paint method should just override paintComponent.

recomputeSizeback to summary
pack-priv void recomputeSize()
setFontback to summary
public void setFont(Font f)

Overrides javax.swing.JComponent.setFont.

Doc from javax.swing.JComponent.setFont.

Sets the font for this component.

setShowLineNumbersback to summary
public void setShowLineNumbers(boolean val)
setViewportback to summary
pack-priv void setViewport(JViewport view)