📄 abstractmainview.java~1~
字号:
* @see #setMatchedBracketBGColor
*/
public Color getMatchedBracketBGColor() {
return matchedBracketBGColor;
}
/*****************************************************************************/
/**
* Returns the border color used in bracket matching.
*
* @return The border color used when highlighting a bracket.
* @see #setMatchedBracketBorderColor
*/
public Color getMatchedBracketBorderColor() {
return matchedBracketBorderColor;
}
/*****************************************************************************/
/**
* Returns the color being used for the carets of all text areas in this
* main view.
*
* @return The <code>java.awt.Color</code> being used for all carets.
*/
public Color getCaretColor() {
return caretColor;
}
/*****************************************************************************/
/**
* Returns the color being used to highlight the current line. Note that
* if highlighting the current line is turned off, you will not be seeing
* this highlight.
*
* @return The color being used to highlight the current line.
* @see #isCurrentLineHighlightEnabled
* @see #setCurrentLineHighlightEnabled
* @see #setCurrentLineHighlightColor
*/
public Color getCurrentLineHighlightColor() {
return currentLineColor;
}
/*****************************************************************************/
/**
* Returns the currently active text area.
*
* @return The currently active text area.
*/
public RTextEditorPane getCurrentTextArea() {
return currentTextArea;
}
/*****************************************************************************/
/**
* Returns the name being displayed for the document. For example, in a
* tabbed pane subclass, this could be the text on the tab for this
* document.
*
* @param index The index at which to find the name. If the index is
* invalid, <code>null</code> is returned.
* @return The name being displayed for this document.
*/
public abstract String getDocumentDisplayNameAt(int index);
/*****************************************************************************/
/**
* Returns the location of the document selection area of this component.
*
* @return The location of the document selection area.
*/
public abstract int getDocumentSelectionPlacement();
/*****************************************************************************/
/**
* Returns the index of the specified document.
*
* @return The index of the specified file, or <code>-1</code> if the file
* is not being edited.
*/
public int getFileIndex(String fileFullPath) {
int numDocuments = getNumDocuments();
for (int i=0; i<numDocuments; i++) {
if (getRTextEditorPaneAt(i).getFileFullPath().equals(fileFullPath))
return i;
}
return -1;
}
/*****************************************************************************/
/**
* Returns the system icon associated with the file being edited in the
* given scroll pane (actually, in the text area inside of it). This
* method is called by subclasses that want to display a system icon for
* open files.
*
* @param scrollPane The scroll pane.
* @return The icon.
*/
protected Icon getIconFor(RTextScrollPane scrollPane) {
RTextEditorPane textArea = (RTextEditorPane)scrollPane.textArea;
return FileTypeIconManager.getInstance().getIconFor(textArea);
}
/*****************************************************************************/
/**
* Returns whether or not line numbers are visible in the open documents.
*/
public boolean getLineNumbersEnabled() {
return lineNumbersEnabled;
}
/*****************************************************************************/
/**
* Returns whether or not line (word) wrap is enabled for the open
* documents.
*/
public boolean getLineWrap() {
return lineWrapEnabled;
}
/*****************************************************************************/
/**
* Returns the cursor to use when a macro is being recorded.
*
* @return The cursor for text areas when a macro is being recorded.
*/
private static synchronized final Cursor getMacroCursor() {
if (macroCursor==null) {
// OS's will force the cursor to be a certain size (e.g., Windows
// will make it 32x32 usually), even if you try to set the cursor
// to some other size. So, we create a cursor that is the "best"
// cursor size to prevent our cursor image from being stretched.
try {
java.awt.Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
java.awt.Dimension dim = toolkit.getBestCursorSize(16,16);
BufferedImage transparentImage = new BufferedImage(
dim.width, dim.height,
BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = transparentImage.createGraphics();
BufferedImage image = null;
ClassLoader cl = AbstractMainView.class.getClassLoader();
image = ImageIO.read(cl.getResource(
"org/fife/rtext/graphics/macrocursor.gif"));
g2d.drawImage(image,0,0,null);
g2d.dispose();
Point hotspot = new Point(0,0);
macroCursor = toolkit.createCustomCursor(transparentImage,
hotspot, "macroCursor");
// If something fails (such as the cursor image not being found),
// just use the crosshair cursor.
} catch (Exception e) {
macroCursor = Cursor.getPredefinedCursor(
Cursor.CROSSHAIR_CURSOR);
}
} // End of if (macroCursor==null).
return macroCursor;
}
/*****************************************************************************/
/**
* Returns the margin line's color.
*
* @return The color of the margin (even if it is not enabled).
* @see #setMarginLineColor
*/
public Color getMarginLineColor() {
return marginLineColor;
}
/*****************************************************************************/
/**
* Returns the position of the margin line (even if it is not enabled).
*
* @return The position of the margin line.
* @see #setMarginLinePosition
*/
public int getMarginLinePosition() {
return marginLinePosition;
}
/*****************************************************************************/
/**
* Returns the color selected by the user for "mark all."
*
* @return The color.
* @see #setMarkAllHighlightColor
*/
public Color getMarkAllHighlightColor() {
return markAllHighlightColor;
}
/*****************************************************************************/
/**
* Gets the color used to highlight modified documents' display names.
*
* @return color The color used.
* @see #setModifiedDocumentDisplayNamesColor
* @see #highlightModifiedDocumentDisplayNames
* @see #setHighlightModifiedDocumentDisplayNames
*/
public Color getModifiedDocumentDisplayNamesColor() {
return modifiedDocumentDisplayNameColor;
}
/*****************************************************************************/
/**
* Returns the number of documents open in this container.
*
* @return The number of open documents.
*/
public abstract int getNumDocuments();
/*****************************************************************************/
/**
* Returns all of the files opened in this main view.
*
* @return An array of files representing the files being edited in this
* main view. If no documents are open, <code>null</code> is
* returned.
*/
public File[] getOpenFiles() {
int num = getNumDocuments();
if (num==0)
return null;
File[] files = new File[num];
for (int i=0; i<num; i++) {
files[i] = new File(getRTextEditorPaneAt(i).getFileFullPath());
}
return files;
}
/*****************************************************************************/
/**
* Returns the <code>java.awt.Font</code> currently used to print documents.
*
* @return The font used to print documents. If <code>null</code> is
* returned, that means the current RText font is being used to
* print documents.
* @see #setPrintFont
*/
public Font getPrintFont() {
return printFont;
}
/*****************************************************************************/
/**
* Returns whether selection edges are rounded in text areas.
*
* @return Whether selection edges are rounded.
* @see #setRoundedSelectionEdges
*/
public boolean getRoundedSelectionEdges() {
return roundedSelectionEdges;
}
/*****************************************************************************/
/**
* Returns the <code>RTextEditorPane</code> at the given index.
*
* @param index The tab for which you want to get the
* <code>RTextEditorPane</code>.
* @return The corresponding <code>RTextEditorPane</code>.
*/
public abstract RTextEditorPane getRTextEditorPaneAt(int index);
/*****************************************************************************/
/**
* Returns the <code>org.fife.rtext.RTextScrollPane</code> at the given
* index.
*
* @param index The tab for which you want to get the
* <code>org.fife.rtext.RTextScrollPane</code>.
* @return The scroll pane.
*/
public abstract RTextScrollPane getRTextScrollPaneAt(int index);
/*****************************************************************************/
/**
* Returns the currently active component.
*
* @return The component.
*/
public abstract Component getSelectedComponent();
/*****************************************************************************/
/**
* Returns the currently selected document's index.
*
* @return The index of the currently selected document.
*/
public abstract int getSelectedIndex();
/*****************************************************************************/
/**
* Returns the color being used for selections in all text areas in this
* main view.
*
* @return The <code>java.awt.Color</code> being used for all selections in
* all text areas.
*/
public Color getSelectionColor() {
return selectionColor;
}
/*****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -