當前位置: 首頁>>代碼示例>>Java>>正文


Java RSyntaxTextArea.setAnimateBracketMatching方法代碼示例

本文整理匯總了Java中org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setAnimateBracketMatching方法的典型用法代碼示例。如果您正苦於以下問題:Java RSyntaxTextArea.setAnimateBracketMatching方法的具體用法?Java RSyntaxTextArea.setAnimateBracketMatching怎麽用?Java RSyntaxTextArea.setAnimateBracketMatching使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.fife.ui.rsyntaxtextarea.RSyntaxTextArea的用法示例。


在下文中一共展示了RSyntaxTextArea.setAnimateBracketMatching方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addTextArea

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
private void addTextArea() {
	textArea = new RSyntaxTextArea();
	textArea.setHighlightCurrentLine(true);
	textArea.setAnimateBracketMatching(true);
	textArea.setAntiAliasingEnabled(true);
	textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_HTML);

	scrollBar = new RTextScrollPane(textArea);
	scrollBar.setBorder(null);
	scrollBar.setLineNumbersEnabled(true);
	scrollBar.setViewportView(textArea);

	this.getContentPane().add(scrollBar);
}
 
開發者ID:cristian-henrique,項目名稱:HTML-Viewer,代碼行數:15,代碼來源:HTMLViewer.java

示例2: ScriptEditField

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
public ScriptEditField() {
	scriptDoc = new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
	
	scriptTextArea = new RSyntaxTextArea(scriptDoc);
	scriptTextArea.setAutoIndentEnabled(true);
	scriptTextArea.setAnimateBracketMatching(true);
	scriptTextArea.setCodeFoldingEnabled(true);

	scriptScroll = new RTextScrollPane(scriptTextArea);
	scriptScroll.setLineNumbersEnabled(true);  
	
}
 
開發者ID:cristal-ise,項目名稱:gui,代碼行數:13,代碼來源:ScriptEditField.java

示例3: JavaEditor

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
public JavaEditor(JavaFile file) {
	this.file = file;
	mainSplitPane = new JSplitPane();
	mainSplitPane.setContinuousLayout(true);
	mainSplitPane.setResizeWeight(0.5);

	textArea = new RSyntaxTextArea();
	textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
	textArea.setEditable(false);
	textArea.setAnimateBracketMatching(true);
	textArea.setAntiAliasingEnabled(true);
	textArea.setClearWhitespaceLinesEnabled(true);
	textArea.setCodeFoldingEnabled(true);
	textArea.setPaintMarkOccurrencesBorder(true);
	textArea.setPaintMatchedBracketPair(true);
	textArea.setMarkOccurrences(true);
	textArea.getCaret().addChangeListener(new ChangeListener() {
		@Override
		public void stateChanged(ChangeEvent paramChangeEvent) {
			textArea.getCaret().setVisible(true);
		}
	});

	int mod = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
	ResourceBundle msg = ResourceBundle.getBundle("org.fife.ui.rtextarea.RTextArea");

	RecordableTextAction copyAction = new RTextAreaEditorKit.CopyAction();
	copyAction.setProperties(msg, "Action.Copy");
	copyAction.setAccelerator(KeyStroke.getKeyStroke(67, mod));

	JPopupMenu menu = new JPopupMenu();
	menu.add(createPopupMenuItem(copyAction));
	menu.add(createPopupMenuItem(new RenameAction()));
	textArea.setPopupMenu(menu);

	textArea.setText(
			"package abc;\r\n\r\npublic class Example{\r\n\tprivate int example = 0;\r\n\t\r\n\tpublic void example(){\r\n\t\tSystem.out.println(\"hi!\");\r\n\t}\r\n\t\r\n\tpublic static void main(String[] args){\r\n\t\texample();\r\n\t}\r\n}");

	textArea.convertSpacesToTabs();

	theme.apply(textArea);

	RTextScrollPane scrollPane = new RTextScrollPane(textArea, true);
	scrollPane.getGutter().setBookmarkingEnabled(true);
	scrollPane.getGutter()
			.setBookmarkIcon(new ImageIcon(EditorWindow.class.getResource("/resources/menu/connection.gif")));
	scrollPane.setIconRowHeaderEnabled(true);
	scrollPane.setFoldIndicatorEnabled(true);
	mainSplitPane.setLeftComponent(scrollPane);

	JScrollPane treeScrollPane = new JScrollPane();
	mainSplitPane.setRightComponent(treeScrollPane);

	JTree tree = new JTree();
	tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Example") {
		{
			DefaultMutableTreeNode node_1;
			node_1 = new DefaultMutableTreeNode("Variables");
			node_1.add(new DefaultMutableTreeNode("int example"));
			add(node_1);
			node_1 = new DefaultMutableTreeNode("Methods");
			node_1.add(new DefaultMutableTreeNode("public void example()"));
			node_1.add(new DefaultMutableTreeNode("public static void main(String[] args)"));
			add(node_1);
			add(new DefaultMutableTreeNode("Patches"));
		}
	}));
	treeScrollPane.setViewportView(tree);
}
 
開發者ID:Error22,項目名稱:Lychee,代碼行數:70,代碼來源:JavaEditor.java

示例4: PluginEditor

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
public PluginEditor() {

        setLayout(new BorderLayout());

        textArea = new RSyntaxTextArea(20, 80);
        textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);

        textArea.setBackground(new JLabel().getBackground());
        textArea.setAntiAliasingEnabled(true);
        textArea.setAnimateBracketMatching(false);

        textArea.setCaretColor(textArea.getBackground().brighter().brighter().brighter());
        textArea.setCurrentLineHighlightColor(textArea.getBackground().brighter());
        textArea.setMarginLineColor(textArea.getBackground().darker());
        textArea.setMarginLineEnabled(true);
        textArea.setBracketMatchingEnabled(false);
        textArea.setSelectedTextColor(Color.ORANGE.brighter().brighter());
        textArea.setSelectionColor(Color.ORANGE.darker());
        textArea.setForeground(textArea.getBackground().brighter().brighter().brighter());
        RTextScrollPane sp = new RTextScrollPane(textArea, true, textArea.getBackground().brighter().brighter());
        // sp.setBackground(new Color(255,255,255));
        sp.setForeground(new Color(255, 255, 255));
        sp.getGutter().setBorderColor(textArea.getBackground().darker());
        // sp.putClientProperty(SubstanceLookAndFeel.COLORIZATION_FACTOR, new
        // Double(0.0));
        /*
         * 
         */
        add(sp, BorderLayout.CENTER);

        JToolBar bar = new JToolBar();

        JButton saveButton = new JButton("Save");
        saveButton.setActionCommand("saveButton");
        saveButton.addActionListener(this);
        bar.add(saveButton);

        JButton newButton = new JButton("New");
        newButton.setActionCommand("newButton");
        newButton.addActionListener(this);
        bar.add(newButton);

        JButton openButton = new JButton("Open");
        openButton.setActionCommand("openButton");
        openButton.addActionListener(this);
        bar.add(openButton);

        JButton compileButton = new JButton("Compile");
        compileButton.setActionCommand("compileButton");
        compileButton.addActionListener(this);
        bar.add(compileButton);

        // cp.add(new JLabel("tzes"),BorderLayout.PAGE_START);
        add(bar, BorderLayout.PAGE_START);

        console = new JEditorPane();

        JScrollPane scrollpane = new JScrollPane(console, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        console.setContentType("text/html");
        console.setEditable(true);
        console.setBackground(new JLabel().getBackground());

        // scrollpane.setMinimumSize(new Dimension(0,0));
        scrollpane.setPreferredSize(new Dimension(0, 100));

        console.setContentType("text/plain");
        console.setFont(new Font("Monospaced", Font.PLAIN, 12));
        console.setEditable(false);
        // console.setBackground(Color.WHITE);

        add(scrollpane, BorderLayout.PAGE_END);
        console.setForeground(Color.getHSBColor(0 / 369.f, 0.4f, 0.99f));

        changeStyleProgrammatically();
        // setMinimumSize(getPreferredSize());

    }
 
開發者ID:jdiemke,項目名稱:XPTS,代碼行數:79,代碼來源:PluginEditor.java

示例5: initializeUI

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
private void initializeUI(){
	setLayout(new BorderLayout(0, 0));
	
	JSplitPane splitPaneMain = new JSplitPane();
	splitPaneMain.setOrientation(JSplitPane.VERTICAL_SPLIT);
	add(splitPaneMain, BorderLayout.CENTER);
	
	JPanel panelTop = new JPanel();
	splitPaneMain.setLeftComponent(panelTop);
	panelTop.setLayout(new BorderLayout(0, 0));
	
	JSplitPane splitPaneTop = new JSplitPane();
	splitPaneTop.setResizeWeight(0.3);
	panelTop.add(splitPaneTop);
	
	panelAction = new SamlPanelAction(controller);
	splitPaneTop.setLeftComponent(panelAction);
	
	panelInformation = new SamlPanelInfo();
	splitPaneTop.setRightComponent(panelInformation);
	
	JPanel panelText = new JPanel();
	splitPaneMain.setRightComponent(panelText);
	panelText.setLayout(new BorderLayout(0, 0));
	
	textArea = new RSyntaxTextArea();
	textArea.setText("<failureInInitialization></failureInInitialization>");
       scrollPane = new RTextScrollPane(textArea);
       scrollPane.add(textArea);
       panelText.add(scrollPane, BorderLayout.CENTER);
       scrollPane.setViewportView(textArea);
	
       this.invalidate();
       this.updateUI();
       
       textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
       textArea.setEditable(true);
       textArea.setLineWrap(true);
       textArea.setWrapStyleWord(false);
       textArea.setAnimateBracketMatching(false);
       textArea.setAutoIndentEnabled(false);
       textArea.setBracketMatchingEnabled(false);
}
 
開發者ID:SAMLRaider,項目名稱:SAMLRaider,代碼行數:44,代碼來源:SamlMain.java

示例6: addTextArea

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //導入方法依賴的package包/類
private void addTextArea() {
	jtfFilter = new JTextField();
	findButton = new JButton("Next word");
	textArea = new RSyntaxTextArea();
	textArea.setHighlightCurrentLine(true);
	textArea.setAnimateBracketMatching(true);
	textArea.setAntiAliasingEnabled(true);
	textArea.setEditable(false);
	textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);

	scrollBar = new RTextScrollPane(textArea);
	scrollBar.setBorder(null);
	scrollBar.setLineNumbersEnabled(true);
	scrollBar.setViewportView(textArea);

	this.getContentPane().add(scrollBar);

	JPanel panel = new JPanel(new BorderLayout());
	panel.add(new JLabel("Specify a word to match:"), BorderLayout.WEST);
	panel.add(jtfFilter, BorderLayout.CENTER);
	panel.add(findButton, BorderLayout.EAST);
	add(panel, BorderLayout.SOUTH);

	findButton.addActionListener(e -> {
		String find = jtfFilter.getText().toLowerCase();
		textArea.requestFocusInWindow();
		if (!Strings.isBlank(find)) {
			Document document = textArea.getDocument();
			int findLength = find.length();
			try {
				boolean found = false;
				if (pos + findLength > document.getLength()) {
					pos = 0;
				}
				while (pos + findLength <= document.getLength()) {
					String match = document.getText(pos, findLength).toLowerCase();
					if (match.equals(find)) {
						found = true;
						break;
					}
					pos++;
				}
				if (found) {
					Rectangle viewRect = textArea.modelToView(pos);
					textArea.scrollRectToVisible(viewRect);
					textArea.setCaretPosition(pos + findLength);
					textArea.moveCaretPosition(pos);
					pos += findLength;
				}

			} catch (Exception exp) {
				logger.log(Level.ERROR, exp);
			}

		}
	});
}
 
開發者ID:oswetto,項目名稱:LoboEvolution,代碼行數:58,代碼來源:SourceViewerWindow.java


注:本文中的org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setAnimateBracketMatching方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。