⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diagrameditorcontrols.java

📁 一个图形编辑器
💻 JAVA
字号:
/* * Diagram Editor Application * -------------------------- * * *** Java version *** *  * FILE:     Diaged.java * * JDK:      Compatible with JDK 1.5 * * CONTENTS: Definition of class "DiagramEditorControls" * * AUTHOR:   Zhangyi *  * HISTORY:  Written October 2004 */ import java.awt.* ;import java.applet.* ; class DiagramEditorControls extends Panel{  DiagramEditor diagramEditor ;  Button deleteButton      = new Button("Delete elements") ;  Button nextDiagramButton = new Button("Next diagram") ;  Button newDiagramButton  = new Button("New diagram") ;  Choice toolChoice        = new Choice() ;  public DiagramEditorControls( DiagramEditor e )  {    diagramEditor = e ;    diagramEditor.setControls(this) ;        for (int i = 0; i < diagramEditor.toolNames.length; i++) {      toolChoice.addItem(diagramEditor.toolNames[i]) ;    }    add(newDiagramButton) ;    add(nextDiagramButton) ;    add(new Label("Tool:" )) ;    add(toolChoice) ;    add(deleteButton) ;  }    public boolean action( Event e, Object arg )  {    if (e.target == deleteButton) {      diagramEditor.deleteElements() ;    } else if (e.target == nextDiagramButton) {      diagramEditor.nextDiagram() ;    } else if (e.target == newDiagramButton) {      diagramEditor.newDiagram() ;    } else if ( e.target == toolChoice ) {      int toolIndex = ((Choice) e.target).getSelectedIndex() ;      diagramEditor.setTool(toolIndex) ;    }    return true ;  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -