资源简介
代码片段和文件信息
/*
* @(#)Drawapplet.java
*
* Project: JHotdraw - a GUI framework for technical drawings
* http://www.jhotdraw.org
* http://jhotdraw.sourceforge.net
* Copyright: ?by the original author(s) and all contributors
* License: Lesser GNU Public License (LGPL)
* http://www.opensource.org/licenses/lgpl-license.html
*/
package CH.ifa.draw.applet;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.net.*;
import CH.ifa.draw.framework.*;
import CH.ifa.draw.standard.*;
import CH.ifa.draw.figures.*;
import CH.ifa.draw.util.*;
/**
* DrawApplication defines a standard presentation for
* a drawing editor that is run as an applet. The presentation is
* customized in subclasses.
* Supported applet parameters:
* DRAWINGS: a blank separated list of drawing names that is
* shown in the drawings choice.
*
* @version <$CURRENT_VERSION$>
*/
public class Drawapplet
extends Japplet
implements DrawingEditor PaletteListener VersionRequester {
private transient Drawing fDrawing;
private transient Tool fTool;
private transient DrawingView fView;
private transient ToolButton fDefaultToolButton;
private transient ToolButton fSelectedToolButton;
private transient boolean fSimpleUpdate;
private transient JButton fUpdateButton;
private transient JComboBox fframeColor;
private transient JComboBox fFillColor;
private transient JComboBox fTextColor;
private transient JComboBox fArrowChoice;
private transient JComboBox fFontChoice;
private transient Thread fSleeper;
private transient UndoManager myUndoManager;
static String fgUntitled = “untitled“;
private static final String fgDrawPath = “/CH/ifa/draw/“;
public static final String IMAGES = fgDrawPath+“images/“;
/**
* Initializes the applet and creates its contents.
*/
public void init() {
createIconkit();
getVersionControlStrategy().assertCompatibleVersion();
setUndoManager(new UndoManager());
getContentPane().setLayout(new BorderLayout());
fView = createDrawingView();
JPanel attributes = createAttributesPanel();
createAttributeChoices(attributes);
getContentPane().add(“North“ attributes);
JPanel toolPanel = createToolPalette();
createTools(toolPanel);
getContentPane().add(“West“ toolPanel);
getContentPane().add(“Center“ (Component)view());
JPanel buttonPalette = createButtonPanel();
createButtons(buttonPalette);
getContentPane().add(“South“ buttonPalette);
initDrawing();
// JFC should have its own internal double buffering...
//setBufferedDisplayUpdate();
setupAttributes();
}
public void addViewChangeListener(ViewChangeListener vsl) {
}
public void removeViewChangeListener(ViewChangeListener vsl) {
}
protected Iconkit createIconkit() {
return new Iconkit(this);
}
/*
* Gets the i
- 上一篇:网上报名系统 毕业设计
- 下一篇:pac8000io资料
评论
共有 条评论