锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久超级碰视频,91精品综合久久久久久五月天,日韩av综合中文字幕http://www.aygfsteel.com/panda084/archive/2008/09/13/228690.htmlPandaPandaFri, 12 Sep 2008 17:27:00 GMThttp://www.aygfsteel.com/panda084/archive/2008/09/13/228690.htmlhttp://www.aygfsteel.com/panda084/comments/228690.htmlhttp://www.aygfsteel.com/panda084/archive/2008/09/13/228690.html#Feedback0http://www.aygfsteel.com/panda084/comments/commentRss/228690.htmlhttp://www.aygfsteel.com/panda084/services/trackbacks/228690.htmlVector鎴戜篃鍙互鍋?/span>

榪欎簺騫達紝 CRH銆佹敮綰垮鏈恒?#8220;紲炰簲”銆?#8220;紲炲叚”鐨勫嚭鐜幫紝鎯婂徆縐戞妧鐨勫己澶с傚湪榪欏叾涓綆楁満杈呭姪璁捐錛岃綆楁満浠跨湡絳夋妧鏈湪鍏朵腑璧風潃閲嶈鐨勪綔鐢ㄣ?/span>

         璁$畻鏈鴻緟鍔╄璁?/span>(CAD)鏄竴欏瑰埄鐢ㄨ綆楁満鐭㈤噺鍥懼艦鎶鏈潵瀹屾垚鍥懼艦緇樺埗銆佷慨鏀圭瓑宸ヤ綔鐨勬妧鏈傜敱浜庣煝閲忓浘褰㈠鐞嗗叿鏈夋暟鎹簿搴﹂珮銆佷繚鐪熸ц兘濂姐佷慨鏀規柟渚跨瓑鐗圭偣錛岀幇鍦ㄨ騫挎硾搴旂敤浜庡伐紼嬭璁°佸伐涓氬姞宸ャ佹縺鍏夐洉鍒匯佹縺鍏夋墦鏍囩瓑棰嗗煙鍜岃涓氥?/span>

       鐜板湪鐩墠鐨勭煝閲忓浘褰㈠鐞嗙殑杞歡寰堝銆傚宸ヤ笟璁捐涓婄敤寰楁瘮杈冨鐨?/span>AutoCAD銆?/span>UG銆?/span>Pro/E錛屽鉤闈㈣璁°佹帓鐗堜笂鐢ㄧ殑CorelDraw銆?/span>Illustrator錛屾縺鍏夋爣鍒昏涓氫笂鐢ㄧ殑EzCAD錛岀數瀛愯璁′笂鐢ㄧ殑Protel絳夌瓑銆傚畠浠悇鏈夊叾渚ч噸錛屾槸鐢變簬搴旂敤鑰屽喅瀹氱殑錛屼絾鍏朵腑鐨勬牳蹇冨鐞嗘満鍒舵槸涓鏍楓?/span>

         涓嶇煡浣犳槸鍚︽兂鍦ㄤ綘鐨勫伐浣滀腑鐢ㄨ繖涓綾葷殑杞歡錛屾槸鍚︽湁瑙夊緱榪欎簺鐜版湁鐨勮蔣浠訛紝鍦ㄦ煇浜涙柟闈笉閫傚悎浣犳墍澶勭殑琛屼笟銆備笉綆℃槸鍚︽槸紼嬪簭鍛橈紝鍙浣犳湁榪欐柟闈㈢殑鍏磋叮錛屾垜鎯沖拰澶у涓璧風爺絀跺浣曞仛鐭㈤噺鍥懼艦澶勭悊杞歡銆?/span>

涓銆?鐑韓

         璇翠簡榪欎箞澶氾紝 鎴戞兂鍏堢儹鐑韓錛屽仛涓涓兘鐢葷嚎鐨勭▼搴忋傦紙榪欓噷鎴戠敤Java鍋氫負寮鍙戣璦錛屼富瑕佹槸鑰冭檻鍏剁畝鍗曘佹槗瀛︼紝閫傚悎浜庡垵瀛﹁咃級

         1銆佸緩涓涓敤浜庡瓨鍌ㄧ嚎鏁版嵁鐨勭被

class LineData

{

         private int x1, x2, y1, y2;

         public int getX1() {

                   return x1;

         }

         public void setX1(int x1) {

                   this.x1 = x1;

         }

         public int getX2() {

                   return x2;

         }

         public void setX2(int x2) {

                   this.x2 = x2;

         }

         public int getY1() {

                   return y1;

         }

         public void setY1(int y1) {

                   this.y1 = y1;

         }

         public int getY2() {

                   return y2;

         }

         public void setY2(int y2) {

                   this.y2 = y2;

         }

         public LineData(int x1, int y1, int x2, int y2)

         {

                   this.x1 = x1;

                   this.x2 = x2;

                   this.y1 = y1;

                   this.y2 = y2;

         }

         public LineData(LineData line)

         {

                   this(line.x1, line.y1, line.x2, line.y2);

         }

         public LineData()

         {

                   this(0,0,0,0);

         }

}

         2銆佺幇鍦ㄥ彲浠ュ緩涓涓敾甯冪敤浜庡搷搴旈紶鏍囩偣鍑匯佺Щ鍔ㄦ搷浣滅敤浜庣粯鍥俱?/span>

         1) 榪欓噷榪欎釜綾葷戶鎵胯嚦JPanel綾伙紝鍚屾椂涓轟簡鍝嶅簲榧犳爣鎿嶄綔瀹炵幇MouseListener, MouseMotionListener鎺ュ彛錛?/span>public class Canvas extends JPanel implements ICanvas, MouseListener, MouseMotionListener銆傚湪綾葷殑鏋勯犲櫒涓婂姞鍏?/span>

                   addMouseListener(this);

                   addMouseMotionListener(this);

         璇彞銆?/span>

         2) 鍦ㄧ被鍔犲叆涓変釜鍙橀噺錛?/span>

         a)鐢ㄤ簬瀛樺綋鍓嶆椿璺冪殑綰夸俊鎭殑綰挎暟鎹細LineData active = new LineData();

         b)鐢ㄤ簬瀛樺凡鐢誨ソ鐨勭嚎闆嗘暟鎹細Vector<LineData> lines = new Vector<LineData>();

         c)鐢ㄤ簬瀛樺綋鍓嶇敾鎿嶄綔鐘舵侊細boolean isDrawing = false;

         3) 鐜板湪鍐欎竴涓敾綰塊泦鐨勬柟娉曪細

         private void drawLines()

         {

                   for(LineData line : lines)

                   {

                            g.drawLine(line.getX1(), line.getY1(), line.getX2(), line.getY2());

                   }

         }

         4) 閲嶈澆JPanel涓殑paintCompomont鏂規硶

         @Override

         public void paintComponent(Graphics g) {

                   super.paintComponent(g);

                   drawLines(g);

                   if(isDrawing)

                            g.drawLine(active.getX1(), active.getY1(), active.getX2(), active.getY2());

         }

         5)鐜板湪鍙互瀹炵幇榧犳爣鍝嶅簲錛?/span>

         a) 榧犳爣鎸変笅

         @Override

         public void mousePressed(MouseEvent e) {

                   int x = e.getX();

                   int y = e.getY();

                   isDrawing = !isDrawing;

                   if(isDrawing)

                   {

                            active.setX1(x);

                            active.setY1(y);

                   }

                   else

                   {

                            active.setX2(x);

                            active.setY2(y);

                            lines.add(new LineData(active));

                   }

         }

         b) 榧犳爣縐誨姩

         @Override

         public void mouseMoved(MouseEvent e) {

                   int x = e.getX();

                   int y = e.getY();

                   if(isDrawing)

                   {

                            active.setX2(x);

                            active.setY2(y);

                            repaint();

                   }

         }

         3銆佸疄鐜頒富紿椾綋

public class LinePaint extends JFrame {

         public static void main(String args[]) {

                   EventQueue.invokeLater(new Runnable() {

                            public void run() {

                                     try {

                                               LinePaint frame = new LinePaint();

                                               frame.setVisible(true);

                                     } catch (Exception e) {

                                               e.printStackTrace();

                                     }

                            }

                   });

         }

         public LinePaint() {

                   super();

                   setBounds(100, 100, 500, 375);

                   setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                   getContentPane().add(new Canvas());

         }

}


婧愪唬鐮?

/Files/panda084/LinePaint.rar





Panda 2008-09-13 01:27 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 定边县| 忻城县| 阿坝| 大安市| 盱眙县| 正安县| 龙胜| 夏邑县| 梅河口市| 华宁县| 夏河县| 阳曲县| 海城市| 赣榆县| 常熟市| 北票市| 丰台区| 临夏市| 庆城县| 城固县| 普宁市| 玉山县| 体育| 嵩明县| 崇明县| 平凉市| 西平县| 寿阳县| 长沙县| 循化| 秀山| 蒙城县| 资中县| 镇赉县| 青岛市| 阳江市| 雷州市| 柳州市| 娄底市| 弥渡县| 旬阳县|