• 大小: 1.72MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-09
  • 语言: Java
  • 标签: 绘图板  Java  

资源简介

绘图板程序设计具体实现,附带jar文件,附带示例。本来不收费的,可是最低收费为1分,想要的可以私我。

资源截图

代码片段和文件信息

package Rendering;

import Rendering.element.BeginEndImageElement;
import Rendering.element.ImageElement;
import Rendering.element.SaveImageElement;
import Rendering.element.Similarable;
import Rendering.strategy.*;
import Rendering.utils.Matrix3x3f;
import Rendering.utils.Swingframework;
import Rendering.utils.Utility;
import Rendering.utils.Vector2f;
import Rendering.strategy.FillPolygonStrategy;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;

public class Editor extends Swingframework {
    protected ArrayList elements;
    protected HashMap strategy;
    protected Strategy currentStrategy;
    protected Color currentColor;
    protected boolean similar;
    protected JButton backgroundButton;
    protected JButton colorButton;
    protected JButton similarButton;
    protected BufferedImage lastImage;


    public Editor() {
        appBorder = new Color(0xFFEBCD);
        appBackground = Color.WHITE;
        appFont = new Font(“Courier New“ Font.PLAIN 20);
        appWidth = 1080;
        appHeight = 720;
        appWorldWidth = 16.0f;
        appWorldHeight = 9.0f;
        appSleep = 10L;
        appMaintainRatio = true;
        appBorderScale = 0.95f;
        apptitle = “Editor“;
        currentColor = Color.BLACK;
        similar = false;
    }

    @Override
    protected void onCreateAndShowGUI() {
        JMenuBar menuBar = new JMenuBar();
        JMenu menu = new JMenu(“File“);
        JMenuItem item = new JMenuItem(new AbstractAction(“New“) {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (saved()) {
                    onNew();
                } else {
                    int isSave = JOptionPane.showConfirmDialog(Editor.this “是否保存文件?“
                            “保存“ JOptionPane.YES_NO_OPTION);
                    if (isSave == JOptionPane.NO_OPTION) {
                        onNew();
                    } else {
                        save();
                    }
                }
            }
        });
        menu.add(item);
        item = new JMenuItem(new AbstractAction(“Open“) {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (saved()) {
                    onOpen();
                } else {
                    int isSave = JOptionPane.showConfirmDialog(Editor.this “是否保存文件?“
                            “保存“ JOptionPane.YES_NO_OPTION);
                    if (isSave == JOptionPane.NO_OPTION) {
                        onOpen();
                    } else {
                        save();
                    }
                }
            }
        });
        menu.add(item);
        item = new JMenuItem(new AbstractAction(“Save“) {
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      30172  2018-05-30 20:13  Rendering\Editor.java

     文件        832  2018-05-30 20:13  Rendering\element\BeginEndImageElement.java

     文件       2010  2018-05-30 20:13  Rendering\element\FillPolygon.java

     文件        302  2018-05-30 20:13  Rendering\element\ImageElement.java

     文件       1445  2018-05-30 20:13  Rendering\element\Points.java

     文件        220  2018-05-30 20:13  Rendering\element\SaveImageElement.java

     文件        201  2018-05-30 20:13  Rendering\element\Similarable.java

     文件        785  2018-05-30 20:13  Rendering\element\StringElement.java

     文件      13468  2018-05-30 19:37  Rendering\example0.jpg

     文件      40167  2018-05-30 20:06  Rendering\example1.jpg

     文件    1232041  2018-05-30 19:01  Rendering\index.png

     文件     133819  2018-05-30 19:32  Rendering\is0.jpg

     文件     130322  2018-05-30 19:11  Rendering\is1.jpg

     文件     129888  2018-05-30 19:27  Rendering\is2.jpg

     文件     262715  2018-05-30 20:26  Rendering\Rendering.jar

     文件       1976  2018-05-30 20:13  Rendering\strategy\BeginEndStrategy.java

     文件       2795  2018-05-30 20:13  Rendering\strategy\FillPolygonStrategy.java

     文件        635  2018-05-30 20:13  Rendering\strategy\NullStrategy.java

     文件       1378  2018-05-30 20:13  Rendering\strategy\PointsStrategy.java

     文件       2615  2018-05-30 20:28  Rendering\strategy\Strategy.java

     文件       2677  2018-05-30 20:13  Rendering\strategy\StringStrategy.java

     文件       1778  2018-05-30 20:13  Rendering\utils\frameRate.java

     文件       7082  2018-05-30 20:13  Rendering\utils\framework.java

     文件       4085  2018-05-30 20:13  Rendering\utils\Matrix3x3f.java

     文件       4218  2018-05-30 20:13  Rendering\utils\RelativeMouseInput.java

     文件       2440  2018-05-30 20:13  Rendering\utils\SafeKeyboardInput.java

     文件       2993  2018-05-30 20:13  Rendering\utils\Swingframework.java

     文件      12726  2018-05-30 20:13  Rendering\utils\Utility.java

     文件       6540  2018-05-30 20:13  Rendering\utils\Vector2f.java

     目录          0  2018-06-06 14:59  Rendering\element

............此处省略6个文件信息

评论

共有 条评论