图形编辑器生成代码(图形化代码编辑器)
admin 发布:2022-12-19 15:37 146
本篇文章给大家谈谈图形编辑器生成代码,以及图形化代码编辑器对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。
本文目录一览:
有哪些好用的代码编辑器值得推荐?
作为一个程序开发者,日常的开发工作绝对离不开代码编辑器,不管是前端还是后台,下面几款常用的代码编辑器,可以试试:
1.Notepad++:相信大部分开发人员都听说或使用过这个代码编辑器,记事本的增强版,免费开源、小巧灵活、使用方便,支持常见的自动补全、语法提示、代码高亮,可编辑语言多达27种。
2.EditPlus:这也是一款小巧灵活的代码编辑器,功能类似于Notepad++,拥有强大的文本处理功能,界面简洁美观,启动速度较快,支持常见的语法高亮、代码折叠等功能。
3.PNEdit:这是由上海一家科技公司开发研制的一款免费、跨平台的文本编辑器,支持几乎所有主流语言开发,常见的语法高亮、智能补全、语法检查、括号匹配,这个软件都支持,除此之外,还支持git功能,插件扩展丰富,下载配置相关插件后,可直接调试、运行,在业界是一个非常受欢迎的代码编辑器,张江男工作所选。
相信,对于大部分日常开发工作来说,完全够用了,当然,你也可以使用对应的IDE来完成相关工作
完成一个JAVA Application应用开发:图形编辑器
/* 编写一个Java Application 程序,随机产生10个整数,然后按照冒泡排序法排序,接着等待用户输入一个任意整数, 按照折半查找算法在这10个数中查找,将查找结果显示在一个 200*200的窗口中。如果有则在窗口中显示该数,否则显示“No such numbe...
有哪些好用的代码编辑器值得推荐
给大家推荐8款最受程序员喜爱的代码编辑器
1、Atom
Atom是Github打造的一款开源代码编辑器,支持 macOS、Windows和Linux操作系统,支持Node.js所写的插件,并内置由Github提供的Git版本控制系统,也可被当作 IDE 使用。
Atom的特色在于它极其丰富的可定制性,以及赏心悦目的界面。特别是自带的代码缩略图和代码折叠功能,不管是用Python还是做前端都非常好用。
2、EMACS
EMACS的强大之处在于已经超出了编辑器的范畴,搞成了大的平台,很多开发人员在上面直接都以他为入口完成各种功能需求了。
主要有如下特性:上网浏览网页看视频,收发邮件,调试程序,玩游戏,计算器,;、文件比较,记日记,目录管理
3、Notepad++
Notepad++被称为是JAVA程序员的最爱,几乎可以替代记事本的最佳编辑器,很多强大的功能集于一身。可以在Windows操作系统下编辑,有完整的中文化接口支持多国语言编写的功能(UTF8技术),支持自定义语言。该程序还支持自动完成某些编程语言的API子集。
4、Sublime Text
Sublime 是一种比Notepad++功能强大的多编辑器,现在很多前端开发人员都很喜欢,虽然代码不开源,里面需要拿到注册码才能使用,但是它几乎涵盖了notepad++的所有特性,界面美观功能全的编辑器。
主要有如下特性:
跨平台,几乎在各个操作系统上都能使用
查找和替换功能做得非常友善
不仅支持多种语言关键字的高亮提示,还能针对编程语言编译错误给提示
支持插件功能
能够支持多种布局方式
5、Brackets
Brackets是一款为Linux开发者设计的开源代码编辑器,使用Brackets写代码,你不会被任何事情所打断。比如在写HTML代码时,即便你没有保存代码也可以及时预览你的Web页面效果。你也可以使用Theseus来检查变量,Brackets默认提供一种主题,当然你也可以在扩展中心获取更多的主题。
6、Vim
Vim 是一款高度可定制的文本编辑器,可以用于包括编写代码在内的各种文本创建与编辑工作。
Vim 的特色在于,它可以仅仅通过键盘来在插入、执行命令、文本批量处理等模式之中切换。这就使得 Vim 可以不用进行菜单或者鼠标操作,并且最小化组合键的操作。对文字录入员或者程序员可以大大增强速度和效率。
7、Visual Studio Code
Visual Studio Code是目前最受欢迎的代码编辑器。Visual Studio Code是一个由微软公司发布的免费开源且跨平台的代码编辑器,刚一问世,它就以强大的功能、美观的界面、高度的可定制性,被誉为微软的良心之作。
Visual StudioCode 内置了代码调试、Git 版本控制、代码高亮、智能代码补完、代码片段管理、代码重构等丰富的功能。此外,VS Code 的用户个性配置选项也很丰富,能方便地修改主题颜色、键盘快捷方式等各种属性和参数,还在内置了扩展程序管理的功能。
8、Eclipse
Eclipse以一种友好的集成开发环境,为各种类型的用户,提供了一系列针对开发Web和Java应用的可用工具。虽然专注于Java,但是也支持其他各种编程语言,如C ++、JavaScript、PHP、C、Perl、Fortran、Ruby、Python,甚至是COBOL。它还包括了适用于各种语言、向导和内置应用程序以简化开发的源代码和图形编辑器,以及支持部署、运行和测试app的工具和API。
Eclipse提供的插件功能相当丰富,有助于更加简便地创建、集成和使用软件工具,节省时间和金钱。
用JAVA实现的图形编辑器
楼主给你一个我的,直接保存成pb.java编译运行,就是你要的画图功能 ,可以参考一下
____________________________________________________________________
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import java.awt.geom.*;
import java.io.*;
class Point implements Serializable
{
int x,y;
Color col;
int tool;
int boarder;
Point(int x, int y, Color col, int tool, int boarder)
{
this.x = x;
this.y = y;
this.col = col;
this.tool = tool;
this.boarder = boarder;
}
}
class paintboard extends Frame implements ActionListener,MouseMotionListener,MouseListener,ItemListener
{
int x = -1, y = -1;
int con = 1;//画笔大小
int Econ = 5;//橡皮大小
int toolFlag = 0;//toolFlag:工具标记
//toolFlag工具对应表:
//(0--画笔);(1--橡皮);(2--清除);
//(3--直线);(4--圆);(5--矩形);
Color c = new Color(0,0,0); //画笔颜色
BasicStroke size = new BasicStroke(con,BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL);//画笔粗细
Point cutflag = new Point(-1, -1, c, 6, con);//截断标志
Vector paintInfo = null;//点信息向量组
int n = 1;
FileInputStream picIn = null;
FileOutputStream picOut = null;
ObjectInputStream VIn = null;
ObjectOutputStream VOut = null;
// *工具面板--画笔,直线,圆,矩形,多边形,橡皮,清除*/
Panel toolPanel;
Button eraser, drLine,drCircle,drRect;
Button clear ,pen;
Choice ColChoice,SizeChoice,EraserChoice;
Button colchooser;
Label 颜色,大小B,大小E;
//保存功能
Button openPic,savePic;
FileDialog openPicture,savePicture;
paintboard(String s)
{
super(s);
addMouseMotionListener(this);
addMouseListener(this);
paintInfo = new Vector();
/*各工具按钮及选择项*/
//颜色选择
ColChoice = new Choice();
ColChoice.add("black");
ColChoice.add("red");
ColChoice.add("blue");
ColChoice.add("green");
ColChoice.addItemListener(this);
//画笔大小选择
SizeChoice = new Choice();
SizeChoice.add("1");
SizeChoice.add("3");
SizeChoice.add("5");
SizeChoice.add("7");
SizeChoice.add("9");
SizeChoice.addItemListener(this);
//橡皮大小选择
EraserChoice = new Choice();
EraserChoice.add("5");
EraserChoice.add("9");
EraserChoice.add("13");
EraserChoice.add("17");
EraserChoice.addItemListener(this);
////////////////////////////////////////////////////
toolPanel = new Panel();
clear = new Button("清除");
eraser = new Button("橡皮");
pen = new Button("画笔");
drLine = new Button("画直线");
drCircle = new Button("画圆形");
drRect = new Button("画矩形");
openPic = new Button("打开图画");
savePic = new Button("保存图画");
colchooser = new Button("显示调色板");
//各组件事件监听
clear.addActionListener(this);
eraser.addActionListener(this);
pen.addActionListener(this);
drLine.addActionListener(this);
drCircle.addActionListener(this);
drRect.addActionListener(this);
openPic.addActionListener(this);
savePic.addActionListener(this);
colchooser.addActionListener(this);
颜色 = new Label("画笔颜色",Label.CENTER);
大小B = new Label("画笔大小",Label.CENTER);
大小E = new Label("橡皮大小",Label.CENTER);
//面板添加组件
toolPanel.add(openPic);
toolPanel.add(savePic);
toolPanel.add(pen);
toolPanel.add(drLine);
toolPanel.add(drCircle);
toolPanel.add(drRect);
toolPanel.add(颜色); toolPanel.add(ColChoice);
toolPanel.add(大小B); toolPanel.add(SizeChoice);
toolPanel.add(colchooser);
toolPanel.add(eraser);
toolPanel.add(大小E); toolPanel.add(EraserChoice);
toolPanel.add(clear);
//工具面板到APPLET面板
add(toolPanel,BorderLayout.NORTH);
setBounds(60,60,900,600); setVisible(true);
validate();
//dialog for save and load
openPicture = new FileDialog(this,"打开图画",FileDialog.LOAD);
openPicture.setVisible(false);
savePicture = new FileDialog(this,"保存图画",FileDialog.SAVE);
savePicture.setVisible(false);
openPicture.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{ openPicture.setVisible(false); }
});
savePicture.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{ savePicture.setVisible(false); }
});
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{ System.exit(0);}
});
}
public void paint(Graphics g)
{
Graphics2D g2d = (Graphics2D)g;
Point p1,p2;
n = paintInfo.size();
if(toolFlag==2)
g.clearRect(0,0,getSize().width,getSize().height);//清除
for(int i=0; in ;i++){
p1 = (Point)paintInfo.elementAt(i);
p2 = (Point)paintInfo.elementAt(i+1);
size = new BasicStroke(p1.boarder,BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL);
g2d.setColor(p1.col);
g2d.setStroke(size);
if(p1.tool==p2.tool)
{
switch(p1.tool)
{
case 0://画笔
Line2D line1 = new Line2D.Double(p1.x, p1.y, p2.x, p2.y);
g2d.draw(line1);
break;
case 1://橡皮
g.clearRect(p1.x, p1.y, p1.boarder, p1.boarder);
break;
case 3://画直线
Line2D line2 = new Line2D.Double(p1.x, p1.y, p2.x, p2.y);
g2d.draw(line2);
break;
case 4://画圆
Ellipse2D ellipse = new Ellipse2D.Double(p1.x, p1.y, Math.abs(p2.x-p1.x) , Math.abs(p2.y-p1.y));
g2d.draw(ellipse);
break;
case 5://画矩形
Rectangle2D rect = new Rectangle2D.Double(p1.x, p1.y, Math.abs(p2.x-p1.x) , Math.abs(p2.y-p1.y));
g2d.draw(rect);
break;
case 6://截断,跳过
i=i+1;
break;
default :
}//end switch
}//end if
}//end for
}
public void itemStateChanged(ItemEvent e)
{
if(e.getSource()==ColChoice)//预选颜色
{
String name = ColChoice.getSelectedItem();
if(name=="black")
{c = new Color(0,0,0); }
else if(name=="red")
{c = new Color(255,0,0);}
else if(name=="green")
{c = new Color(0,255,0);}
else if(name=="blue")
{c = new Color(0,0,255);}
}
else if(e.getSource()==SizeChoice)//画笔大小
{
String selected = SizeChoice.getSelectedItem();
if(selected=="1")
{
con = 1;
size = new BasicStroke(con,BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL);
}
else if(selected=="3")
{
con = 3;
size = new BasicStroke(con,BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL);
}
else if(selected=="5")
{con = 5;
size = new BasicStroke(con,BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL);
}
else if(selected=="7")
{con = 7;
size = new BasicStroke(con,BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL);
}
else if(selected=="9")
{con = 9;
size = new BasicStroke(con,BasicStroke.CAP_BUTT,BasicStroke.JOIN_BEVEL);
}
}
else if(e.getSource()==EraserChoice)//橡皮大小
{
String Esize = EraserChoice.getSelectedItem();
if(Esize=="5")
{ Econ = 5*2; }
else if(Esize=="9")
{ Econ = 9*2; }
else if(Esize=="13")
{ Econ = 13*2; }
else if(Esize=="17")
{ Econ = 17*3; }
}
}
public void mouseDragged(MouseEvent e)
{
Point p1 ;
switch(toolFlag){
case 0://画笔
x = (int)e.getX();
y = (int)e.getY();
p1 = new Point(x, y, c, toolFlag, con);
paintInfo.addElement(p1);
repaint();
break;
case 1://橡皮
x = (int)e.getX();
y = (int)e.getY();
p1 = new Point(x, y, null, toolFlag, Econ);
paintInfo.addElement(p1);
repaint();
break;
default :
}
}
public void mouseMoved(MouseEvent e) {}
public void update(Graphics g)
{
paint(g);
}
public void mousePressed(MouseEvent e)
{
Point p2;
switch(toolFlag){
case 3://直线
x = (int)e.getX();
y = (int)e.getY();
p2 = new Point(x, y, c, toolFlag, con);
paintInfo.addElement(p2);
break;
case 4: //圆
x = (int)e.getX();
y = (int)e.getY();
p2 = new Point(x, y, c, toolFlag, con);
paintInfo.addElement(p2);
break;
case 5: //矩形
x = (int)e.getX();
y = (int)e.getY();
p2 = new Point(x, y, c, toolFlag, con);
paintInfo.addElement(p2);
break;
default :
}
}
public void mouseReleased(MouseEvent e)
{
Point p3;
switch(toolFlag){
case 0://画笔
paintInfo.addElement(cutflag);
break;
case 1: //eraser
paintInfo.addElement(cutflag);
break;
case 3://直线
x = (int)e.getX();
y = (int)e.getY();
p3 = new Point(x, y, c, toolFlag, con);
paintInfo.addElement(p3);
paintInfo.addElement(cutflag);
repaint();
break;
case 4: //圆
x = (int)e.getX();
y = (int)e.getY();
p3 = new Point(x, y, c, toolFlag, con);
paintInfo.addElement(p3);
paintInfo.addElement(cutflag);
repaint();
break;
case 5: //矩形
x = (int)e.getX();
y = (int)e.getY();
p3 = new Point(x, y, c, toolFlag, con);
paintInfo.addElement(p3);
paintInfo.addElement(cutflag);
repaint();
break;
default:
}
}
public void mouseEntered(MouseEvent e){}
public void mouseExited(MouseEvent e){}
public void mouseClicked(MouseEvent e){}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==pen)//画笔
{toolFlag = 0;}
if(e.getSource()==eraser)//橡皮
{toolFlag = 1;}
if(e.getSource()==clear)//清除
{
toolFlag = 2;
paintInfo.removeAllElements();
repaint();
}
if(e.getSource()==drLine)//画线
{toolFlag = 3;}
if(e.getSource()==drCircle)//画圆
{toolFlag = 4;}
if(e.getSource()==drRect)//画矩形
{toolFlag = 5;}
if(e.getSource()==colchooser)//调色板
{
Color newColor = JColorChooser.showDialog(this,"调色板",c);
c = newColor;
}
if(e.getSource()==openPic)//打开图画
{
openPicture.setVisible(true);
if(openPicture.getFile()!=null)
{
int tempflag;
tempflag = toolFlag;
toolFlag = 2 ;
repaint();
try{
paintInfo.removeAllElements();
File filein = new File(openPicture.getDirectory(),openPicture.getFile());
picIn = new FileInputStream(filein);
VIn = new ObjectInputStream(picIn);
paintInfo = (Vector)VIn.readObject();
VIn.close();
repaint();
toolFlag = tempflag;
}
catch(ClassNotFoundException IOe2)
{
repaint();
toolFlag = tempflag;
System.out.println("can not read object");
}
catch(IOException IOe)
{
repaint();
toolFlag = tempflag;
System.out.println("can not read file");
}
}
}
if(e.getSource()==savePic)//保存图画
{
savePicture.setVisible(true);
try{
File fileout = new File(savePicture.getDirectory(),savePicture.getFile());
picOut = new FileOutputStream(fileout);
VOut = new ObjectOutputStream(picOut);
VOut.writeObject(paintInfo);
VOut.close();
}
catch(IOException IOe)
{
System.out.println("can not write object");
}
}
}
}//end paintboard
public class pb
{
public static void main(String args[])
{ new paintboard("画图程序"); }
}
图形编辑器生成代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于图形化代码编辑器、图形编辑器生成代码的信息别忘了在本站进行查找喔。
版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;
相关推荐
- 05-16在线生成网站,在线生成ppt的网站
- 05-09网页代码,网页代码快捷键
- 05-06单页网站的代码(完整的网页代码)[20240506更新]
- 05-06个人主页图片代码(个人主页图片代码怎么弄)[20240506更新]
- 05-06提取微信名片代码(微信名片信息提取)[20240506更新]
- 05-06php后台权限管理代码(php管理员权限)[20240506更新]
- 05-06付费观看代码php(付费观看代码)[20240506更新]
- 05-06在线html执行代码(html怎么运行)[20240506更新]
- 05-06源代码管理资源管理器(资源管理器运行代码)[20240506更新]
- 05-06代码源软件库(程序代码库)[20240506更新]
取消回复欢迎 你 发表评论:
- 标签列表
- 最近发表
- 友情链接