当前位置: 首页>>代码示例>>Java>>正文


Java RSyntaxTextArea.setAntiAliasingEnabled方法代码示例

本文整理汇总了Java中org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setAntiAliasingEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java RSyntaxTextArea.setAntiAliasingEnabled方法的具体用法?Java RSyntaxTextArea.setAntiAliasingEnabled怎么用?Java RSyntaxTextArea.setAntiAliasingEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.fife.ui.rsyntaxtextarea.RSyntaxTextArea的用法示例。


在下文中一共展示了RSyntaxTextArea.setAntiAliasingEnabled方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newTextArea

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
private RSyntaxTextArea newTextArea(){
//        JTextArea textArea = new JTextArea();
//        textArea.setAutoscrolls(true);
////      textArea.getDocument().addUndoableEditListener(undoMg);
//        textArea.addMouseListener(new TextAreaMouseListener());
        RSyntaxTextArea textArea = new RSyntaxTextArea();
        textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
        textArea.setCodeFoldingEnabled(true);
        textArea.setAntiAliasingEnabled(true);
        textArea.setAutoscrolls(true);

        SyntaxScheme scheme = textArea.getSyntaxScheme();
//        scheme.getStyle(Token.COMMENT_KEYWORD).foreground = Color.red;
//      scheme.getStyle(Token.DATA_TYPE).foreground = Color.blue;
        scheme.getStyle(Token.LITERAL_STRING_DOUBLE_QUOTE).foreground = Color.BLUE;
        scheme.getStyle(Token.LITERAL_NUMBER_DECIMAL_INT).foreground = new Color(164, 0, 0);
        scheme.getStyle(Token.LITERAL_NUMBER_FLOAT).foreground = new Color(164, 0, 0);
        scheme.getStyle(Token.LITERAL_BOOLEAN).foreground = Color.RED;
        scheme.getStyle(Token.OPERATOR).foreground = Color.BLACK;
        textArea.revalidate();
        textArea.addMouseListener(new TextAreaMouseListener());
       
        return textArea;
    }
 
开发者ID:nblookup,项目名称:HiJson,代码行数:25,代码来源:MainView.java

示例2: CustomCodeSyntaxPane

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public CustomCodeSyntaxPane() {

		panel = new JPanel(new BorderLayout());
		textArea = new RSyntaxTextArea();
		textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
		textArea.setAntiAliasingEnabled(true);
		textArea.setCodeFoldingEnabled(true);
		textArea.setFont(DerivedConfig.getPanelContentFont());

		// setup autocompletion
		for (String word : getAutocompletionStrings()) {
			provider.addCompletion(new BasicCompletion(provider, word));
		}
		new AutoCompletion(provider).install(textArea);

		scrollPane = new RTextScrollPane(textArea);
		scrollPane.setFoldIndicatorEnabled(true);
		scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
		scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		panel.add(scrollPane);
		textArea.getDocument().putProperty(PlainDocument.tabSizeAttribute, 3); // Reduce tab size
	}
 
开发者ID:umlet,项目名称:umlet,代码行数:23,代码来源:CustomCodeSyntaxPane.java

示例3: 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

示例4: createTextArea

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
private RSyntaxTextArea createTextArea() {
	final RSyntaxTextArea queryText = new RSyntaxTextArea(25, 70);
	queryText.setTabSize(3);
	queryText.setCaretPosition(0);
	queryText.requestFocusInWindow();
	queryText.setMarkOccurrences(false);
	queryText.setCodeFoldingEnabled(true);
	queryText.setClearWhitespaceLinesEnabled(false);
	queryText.setAntiAliasingEnabled(true);
	queryText.setLineWrap(false);

	return queryText;
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:14,代码来源:QueryEditor.java

示例5: PrologSourceEditor

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public PrologSourceEditor() {
  super("Editor", new RSyntaxTextArea());

  final RSyntaxTextArea theEditor = (RSyntaxTextArea) this.editor;
  theEditor.setTabsEmulated(true);
  theEditor.setSyntaxEditingStyle("text/jprol");
  theEditor.getSyntaxScheme().getStyle(Token.VARIABLE).foreground = Color.RED.darker();
  theEditor.getSyntaxScheme().getStyle(Token.VARIABLE).font = theEditor.getFont().deriveFont(Font.BOLD);
  
  theEditor.getInputMap().put(KeyStroke.getKeyStroke("control Z"), "none");
  theEditor.getInputMap().put(KeyStroke.getKeyStroke("control Y"), "none");
  
  theEditor.setAntiAliasingEnabled(true);
  theEditor.setBracketMatchingEnabled(true);
  theEditor.setCodeFoldingEnabled(true);

  removePropertyFromList("EdWordWrap");

  editor.setForeground(Color.BLACK);
  editor.setBackground(Color.WHITE);
  editor.setCaretColor(Color.BLACK);
  editor.setFont(new Font("Courier", Font.BOLD, 14));

  editor.setVisible(true);

  setEnabled(true);

  this.undoManager = new RUndoManager(theEditor);
}
 
开发者ID:raydac,项目名称:jprol,代码行数:30,代码来源:PrologSourceEditor.java

示例6: configure

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
private void configure(Project proj, HdlModel model) {
	this.project = proj;
	this.model = model;
	this.model.addHdlModelListener(modelListener);
	this.addWindowListener(frameListener);

	JPanel buttonsPanel = new JPanel();
	buttonsPanel.add(open);
	buttonsPanel.add(save);
	buttonsPanel.add(validate);
	buttonsPanel.add(close);
	open.addActionListener(frameListener);
	save.addActionListener(frameListener);
	close.addActionListener(frameListener);
	validate.addActionListener(frameListener);

	editor = new RSyntaxTextArea(ROWS, COLUMNS);
	editor.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_DELPHI);
	editor.setCodeFoldingEnabled(true);
	editor.setAntiAliasingEnabled(true);
	editor.getDocument().addDocumentListener(editorListener);

	RTextScrollPane sp = new RTextScrollPane(editor);
	sp.setFoldIndicatorEnabled(true);

	add(sp, BorderLayout.CENTER);
	add(buttonsPanel, BorderLayout.SOUTH);

	LocaleManager.addLocaleListener(frameListener);
	frameListener.localeChanged();
	pack();

	Dimension size = getSize();
	Dimension screen = getToolkit().getScreenSize();
	if (size.width > screen.width || size.height > screen.height) {
		size.width = Math.min(size.width, screen.width);
		size.height = Math.min(size.height, screen.height);
		setSize(size);
	}
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:41,代码来源:HdlContentEditor.java

示例7: 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

示例8: 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

示例9: FindAndReplaceDemo

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public FindAndReplaceDemo() {

		JPanel cp = new JPanel(new BorderLayout());

		textArea = new RSyntaxTextArea(20, 60);
		textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
		textArea.setCodeFoldingEnabled(true);
		textArea.setAntiAliasingEnabled(true);
		RTextScrollPane sp = new RTextScrollPane(textArea);
		sp.setFoldIndicatorEnabled(true);
		cp.add(sp);

		// Create a toolbar with searching options.
		JToolBar toolBar = new JToolBar();
		searchField = new JTextField(30);
		toolBar.add(searchField);
		final JButton nextButton = new JButton("Find Next");
		nextButton.setActionCommand("FindNext");
		nextButton.addActionListener(this);
		toolBar.add(nextButton);
		searchField.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				nextButton.doClick(0);
			}
		});
		JButton prevButton = new JButton("Find Previous");
		prevButton.setActionCommand("FindPrev");
		prevButton.addActionListener(this);
		toolBar.add(prevButton);
		regexCB = new JCheckBox("Regex");
		toolBar.add(regexCB);
		matchCaseCB = new JCheckBox("Match Case");
		toolBar.add(matchCaseCB);
		cp.add(toolBar, BorderLayout.NORTH);

		setContentPane(cp);
		setTitle("Find and Replace Demo");
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		pack();
		setLocationRelativeTo(null);

	}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:44,代码来源:FindAndReplaceDemo.java

示例10: OwnSyntaxPane

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public OwnSyntaxPane() {

		panel = new JPanel(new FlowLayout());
		panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
		textArea = new RSyntaxTextArea() {
			private static final long serialVersionUID = 7431070002967577129L;

			@Override
			public void undoLastAction() {
				CurrentDiagram.getInstance().getDiagramHandler().getController().undo();
			}

			@Override
			public void redoLastAction() {
				CurrentDiagram.getInstance().getDiagramHandler().getController().redo();
			}
		};

		// Setup highlighting
		createHightLightMap();
		AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory) TokenMakerFactory.getDefaultInstance();
		atmf.putMapping(OwnTokenMaker.ID, OwnTokenMaker.class.getName());
		textArea.setSyntaxEditingStyle(OwnTokenMaker.ID);

		textArea.getSyntaxScheme().getStyle(TokenTypes.RESERVED_WORD).foreground = Converter.convert(ColorOwn.SYNTAX_HIGHLIGHTING);

		// Setup autocompletion
		createAutocompletionCompletionProvider();
		AutoCompletion ac = new AutoCompletion(provider);
		// ac.setShowDescWindow(true);
		ac.install(textArea);

		JLabel propertyLabel = new JLabel(" Properties");
		propertyLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
		propertyLabel.setFont(DerivedConfig.getPanelHeaderFont());
		panel.add(propertyLabel);

		textArea.setAntiAliasingEnabled(true);
		textArea.setFont(DerivedConfig.getPanelContentFont());
		scrollPane = new RTextScrollPane(textArea, false);
		scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
		scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
		scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		panel.add(scrollPane);

		textArea.getDocument().putProperty(PlainDocument.tabSizeAttribute, 3); // Reduce tab size
	}
 
开发者ID:umlet,项目名称:umlet,代码行数:48,代码来源:OwnSyntaxPane.java

示例11: SimonkEditorPanel

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public SimonkEditorPanel(KKMulticopterFlashTool parent) {
	this.parent = parent;
	
	//create the CellContraints
	cc  = new CellConstraints();
			
	// create the Layout for Panel this
	String panelColumns = "fill:pref:grow";
	String panelRows = "pref,3dlu,fill:pref:grow,3dlu,pref";
	FormLayout formLayout = new FormLayout(panelColumns, panelRows);
	
	this.setLayout(formLayout);

	githubPanel = new GithubPanel("sim-/tgy");
	githubPanel.addGithubPanelListener(this);
			
	tgyTextArea = new RSyntaxTextArea(20, 60);
	tgyTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_ASSEMBLER_X86);
	tgyTextArea.setCodeFoldingEnabled(true);
	tgyTextArea.setAntiAliasingEnabled(true);
	RTextScrollPane tgyEditorPane = new RTextScrollPane(tgyTextArea);
	tgyEditorPane.setFoldIndicatorEnabled(true);
	tgyEditorPane.setLineNumbersEnabled(true);
	
	incTextArea = new RSyntaxTextArea(20, 60);
	incTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_ASSEMBLER_X86);
	incTextArea.setCodeFoldingEnabled(true);
	incTextArea.setAntiAliasingEnabled(true);
	RTextScrollPane incEditorPane = new RTextScrollPane(incTextArea);
	incEditorPane.setFoldIndicatorEnabled(true);
	incEditorPane.setLineNumbersEnabled(true);
	
	tabs = new JTabbedPane();
	tabs.add("empty",tgyEditorPane);
	tabs.add("empty",incEditorPane);
	
	saveButton = new JButton(_("save"));
	saveButton.addActionListener(this);
	saveButton.setEnabled(false);
	
	compileButton = new JButton(_("compile"));
	compileButton.addActionListener(this);
	compileButton.setEnabled(false);
	
	saveCompileButton = new JButton(_("save") + " & " +_("compile"));
	saveCompileButton.addActionListener(this);
	saveCompileButton.setEnabled(false);
	
	bar = new ButtonBarBuilder2();
	bar.addButton(saveButton);
	bar.addButton(compileButton);
	bar.addGlue();
	bar.addUnrelatedGap();
	bar.addButton(saveCompileButton);
	
	this.add(githubPanel, cc.xy(1, 1));
	this.add(tabs, cc.xy(1, 3));
	this.add(bar.getPanel(), cc.xy(1, 5));

	try {
		Theme theme = Theme.load(SimonkEditorPanel.class.getResourceAsStream("/de/lazyzero/kkMulticopterFlashTool/gui/widgets/dark.xml"));
		theme.apply(tgyTextArea);
		theme.apply(incTextArea);
	} catch (IOException ioe) { // Never happens
		ioe.printStackTrace();
	}
}
 
开发者ID:lazyzero,项目名称:kkMulticopterFlashTool,代码行数:68,代码来源:SimonkEditorPanel.java

示例12: 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

示例13: FindAndReplaceDemo

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea; //导入方法依赖的package包/类
public FindAndReplaceDemo() {

    JPanel cp = new JPanel(new BorderLayout());

    textArea = new RSyntaxTextArea(20, 60);
    textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
    textArea.setCodeFoldingEnabled(true);
    textArea.setAntiAliasingEnabled(true);
    RTextScrollPane sp = new RTextScrollPane(textArea);
    sp.setFoldIndicatorEnabled(true);
    cp.add(sp);

    // Create a toolbar with searching options.
    JToolBar toolBar = new JToolBar();
    searchField = new JTextField(30);
    toolBar.add(searchField);
    final JButton nextButton = new JButton("Find Next");
    nextButton.setActionCommand("FindNext");
    nextButton.addActionListener(this);
    toolBar.add(nextButton);
    searchField.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        nextButton.doClick(0);
      }
    });
    JButton prevButton = new JButton("Find Previous");
    prevButton.setActionCommand("FindPrev");
    prevButton.addActionListener(this);
    toolBar.add(prevButton);
    regexCB = new JCheckBox("Regex");
    toolBar.add(regexCB);
    matchCaseCB = new JCheckBox("Match Case");
    toolBar.add(matchCaseCB);
    cp.add(toolBar, BorderLayout.NORTH);

    setContentPane(cp);
    setTitle("Find and Replace Demo");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    pack();
    setLocationRelativeTo(null);

  }
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:44,代码来源:FindAndReplaceDemo.java


注:本文中的org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.setAntiAliasingEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。