SlideShare a Scribd company logo
1 of 30
Eclipse Draw2D

ECLIPSE DRAW2D
                 조현종(v.05, 12/12/09)
                 http://cafe.naver.com/eclipseplugin
                 http://hangumkj.blogspot.com/
                 hangum@gmail.com
목 차
 Draw2D란?
 Draw2D 살펴보기
 실행 환경
 HelloWorld Draw2D
 Figures 종류
 Painting of Figures
 Layout
 Locator Anchors Routers
 실습
Draw2D란?

 그래픽 생성, 편집, 조작가능
 SWT에 의존
 경량 Widget
 www.eclipse.org/gef
Draw2D 살펴보기

 LightweightSystem?
   SWT Canvas와 Draw2D를 연결 .
   SWT Control 위에서 발생한 이벤트를 Draw2D이
    벤트로 변경
   SWT의 Display와 비슷한 역할을 함
Draw2D 살펴보기

 EventDispatcher?
   SWT Event to Draw2D router
 UpdateManager?
Draw2D 살펴보기

 Figure?
   Draw2D에서 표현 되어 지는 것.
   반드시 하나의 Root Figure가 존재해야함.
   부모 자식과의 관계가 가능 하며, 마우스 이벤트
    등의 이벤트 가능
   SWT의 Shell, Control, Composite등과 비슷함.


  Class는 org.eclipse.draw2d.IFigurer
실행환경

 Eclipse 4.2 SR1
 GEF SDK3.8.1 (update manager
  http://download.eclipse.org/tools/gef/updates/releases/)
HelloWorld Draw2D
                  .




ps) com.ibm.icu?? 추가하세요
Figure

 Figure?
   Draw2D에서 표현 되어 지는 것.
   반드시 하나의 Root Figure가 존재해야함.
   부모 자식과의 관계가 가능 하며, 마우스 이벤트
    등의 이벤트 가능
   SWT의 Shell, Control, Composite등과 비슷함.


  Class는 org.eclipse.draw2d.IFigurer
Figure – Common Figures

 Shapes – rectangle, triangles, ellipse
 Clickables – buttons, checkboxes
 Containers – Panel, ScrollPane
 Connections – figure간의 line
 Layered – figure 들을 layer
 Other – ImageFigure, Label등
Figures 종류?
Figure Border

   CompoundBorder
   FramBorder
   GroupBoxBorder
   LineBorder
   SimpleEtchedBorder
   SimpleLoweredBorder
   SimpleRaisedBorder

 TitleBarBorder
Figures Z-Order

 Figures들은 tree형식을 취합니다
  (Root Figure 존재)
 자식 Figure를 만들 수 있고, 부모와 자식 관
  계를 가집니다
 마지막에 그린 것이 제일위에 표시됩니다.
Event


Listener              Description
FocusListener         포커스를 얻거나 잃었을때
KeyListener
MouseListener         Mouse 클릭, 클릭 후, 버블클릭
MouseMotionListener   Mouse 가 움직일때
                      (mouse enter, mouse hover, mouse move)
Genealogy 예제

 Figure
   RectangleFigure
   PolygonShape
   PolylineConnection
     ChopboxAnchor
 Event
   MouseListener
   MouseMotionListener
Layout 종류
BorderLayout
               Canvas canvas = new Canvas(parent, SWT.NONE);
               LightweightSystem lws = new LightweightSystem(canvas);


               IFigure panel = new Figure();
               BorderLayout layout = new BorderLayout();
               panel.setLayoutManager(layout);


               Button btnLeft = new Button("Left Button");
               panel.setBorder(new LineBorder());
               panel.add(btnLeft, BorderLayout.LEFT);


               Button btnRight = new Button("right Button");
               panel.setBorder(new LineBorder());
               panel.add(btnRight, BorderLayout.RIGHT);


               Button btnTOP = new Button("TOP Button");
               panel.setBorder(new LineBorder());
               panel.add(btnTOP, BorderLayout.TOP);


               lws.setContents(panel);
FlowLayout
             Canvas canvas = new Canvas(parent,
                 SWT.NONE);
             LightweightSystem lws = new
                 LightweightSystem(canvas);

             IFigure panel = new Figure();

             FlowLayout layout = new FlowLayout();
             layout.setHorizontal(true);
             panel.setLayoutManager(layout);

             for (int i = 0; i < 10; i++) {
             panel.add(new Button("button" + i));
             }

             lws.setContents(panel);
XYLayout
           Canvas canvas = new
               Canvas(parent, SWT.NONE);
           LightweightSystem lws = new
               LightweightSystem(canvas);

           IFigure panel = new Figure();

           XYLayout layout = new XYLayout();
           panel.setLayoutManager(layout);

           Button btn = new Button("btn");
           Rectangle rect = new Rectangle(10, 10, 50, 50);
           panel.add(btn);
           panel.setConstraint(btn, rect);

           lws.setContents(panel);
ToolbarLayout
            Canvas canvas = new
                Canvas(parent, SWT.NONE);
            LightweightSystem lws = new
                LightweightSystem(canvas);

            IFigure panel = new Figure();

            ToolbarLayout layout = new ToolbarLayout();
            layout.setVertical(true);
            panel.setLayoutManager(layout);

            for (int i = 0; i < 10; i++) {
            panel.add(new Button("button" + i));
            }

            lws.setContents(panel);
ParagraphTextLayout
         private TextFlow makeTextFlow(String text) {
          TextFlow textFlow = new TextFlow();
          textFlow.setLayoutManager(new
         ParagraphTextLayout(textFlow,
          ParagraphTextLayout.WORD_WRAP_HARD));
          textFlow.setFont(this.getFont());
          textFlow.setText("rn"+text);

             return textFlow;
         }
Connections

 Anchors : Figure간의 선 연결
 Decorations : 선의 끝을 장식
 Routers : 선의 방향을 어떻게 할 것인지~
 Locator : 텍스트를 선의 어느 위치에 놓을
 것인지~
Anchors

 figure들 간에 선 연결
  ChopboxAnchor


  EllipseAnchor


  LabelAnchor


  XYAnchor
Decorations

 선의 끝 모양을 장식


 Default Decorations
   PolylineDecoration
   PolygonDecoration
   RotatableDecoration
Routers

 Router
   NullConnectionRouter


   BendpointConnectionRouter



   MantattanConnectionRouter
Router

 BendpointConnectionRouter
   AbsoluteBendpoint : 절대 좌표 리턴
     AbsoluteBendpoint(350, 10);
   RelativeBendpoint :
     RelativeBendpoint bp2 = new RelativeBendpoint(firstConnection);
     bp2.setRelativeDimensions(new Dimension(-50, 20), new
      Dimension(10, -40));
Connection Labels(Locator)
Locator




                     이 름                         종 류
          BendpointLocator            BendpointConnectionRoutter의
                                      텍스트
          ConnectionEndpointLocator   선의 양끝 텍스트
          MidpointLocator             선의 중앙 텍스트
          ConnectionLocator
          RelativeLocator
PolylineConnection ManhattanConnectionRouter
                           PolylineConnection connection = new PolylineConnection();
                           ..


                           // source label decoration
                           ConnectionEndpointLocator locator = new
                               ConnectionEndpointLocator (connection, false);
                           Label label = new Label("Source");
                           connection.add(label, locator);


                           // target label decoration
                           locator = new ConnectionEndpointLocator (connection, true);
                           label = new Label("Target");
                           connection.add(label, locator);


                           //
                           ManhattanConnectionRouter router = new
                               ManhattanConnectionRouter ();
                           connection.setConnectionRouter (router);


                           // rootFigure에 추가합니다.
                           rootFigure.add(connection);
실습
참고자료

 Addison Wesely The Eclipse Graphical Editing Framework
 Eclipse Help(http://help.eclipse.org/ganymede/index.jsp) – Draw2D
 Eclipse coon 2005 GEF in dept ppt
 SWT/Jface 인 액션(이선아/제갈호준/에이콘)
 http://www13.plala.or.jp/observe/draw2d/draw2d_overview.html
 Eclipse Plug-in & RCP café의 번역문
      http://eclipse-articles.springnote.com/pages/3666185
      http://eclipse-articles.springnote.com/pages/3683263
 http://eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2d.html
 Eclipse Development using the Graphical Editing Framework and the
   Eclipse Modeling Framework(IBM)

More Related Content

What's hot

Exemple de création de base
Exemple de création de baseExemple de création de base
Exemple de création de baseSaber LAJILI
 
Design pattern - Iterator, Mediator and Memento
Design pattern - Iterator, Mediator and MementoDesign pattern - Iterator, Mediator and Memento
Design pattern - Iterator, Mediator and MementoSean Tsai
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitRebecca Murphey
 
Symfony CoP: Form component
Symfony CoP: Form componentSymfony CoP: Form component
Symfony CoP: Form componentSamuel ROZE
 
Intro programacion funcional
Intro programacion funcionalIntro programacion funcional
Intro programacion funcionalNSCoder Mexico
 
Extbase and Beyond
Extbase and BeyondExtbase and Beyond
Extbase and BeyondJochen Rau
 
A New Baseline for Front-End Devs
A New Baseline for Front-End DevsA New Baseline for Front-End Devs
A New Baseline for Front-End DevsRebecca Murphey
 
Electron: From Beginner to Pro
Electron: From Beginner to ProElectron: From Beginner to Pro
Electron: From Beginner to ProChris Griffith
 

What's hot (13)

Exemple de création de base
Exemple de création de baseExemple de création de base
Exemple de création de base
 
Design pattern - Iterator, Mediator and Memento
Design pattern - Iterator, Mediator and MementoDesign pattern - Iterator, Mediator and Memento
Design pattern - Iterator, Mediator and Memento
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
 
Upload text JAVA SCRIPT
Upload text JAVA SCRIPTUpload text JAVA SCRIPT
Upload text JAVA SCRIPT
 
Symfony CoP: Form component
Symfony CoP: Form componentSymfony CoP: Form component
Symfony CoP: Form component
 
Amp Up Your Admin
Amp Up Your AdminAmp Up Your Admin
Amp Up Your Admin
 
Intro programacion funcional
Intro programacion funcionalIntro programacion funcional
Intro programacion funcional
 
Extbase and Beyond
Extbase and BeyondExtbase and Beyond
Extbase and Beyond
 
Cyclejs introduction
Cyclejs introductionCyclejs introduction
Cyclejs introduction
 
Punto fijo multivariante
Punto fijo multivariantePunto fijo multivariante
Punto fijo multivariante
 
A New Baseline for Front-End Devs
A New Baseline for Front-End DevsA New Baseline for Front-End Devs
A New Baseline for Front-End Devs
 
Electron: From Beginner to Pro
Electron: From Beginner to ProElectron: From Beginner to Pro
Electron: From Beginner to Pro
 
Dojo Confessions
Dojo ConfessionsDojo Confessions
Dojo Confessions
 

Viewers also liked

Ek 1552 S Eng
Ek 1552 S EngEk 1552 S Eng
Ek 1552 S Engcipresu
 
Penman - Our PR Process
Penman - Our PR ProcessPenman - Our PR Process
Penman - Our PR Processpdhill
 
Strategies for Using LinkedIn
Strategies for Using LinkedInStrategies for Using LinkedIn
Strategies for Using LinkedInpdhill
 
Den attraktiva gymnasieskolan
Den attraktiva gymnasieskolanDen attraktiva gymnasieskolan
Den attraktiva gymnasieskolanHanna Metsis
 
오픈소스 프로젝트 올챙이
오픈소스 프로젝트 올챙이오픈소스 프로젝트 올챙이
오픈소스 프로젝트 올챙이cho hyun jong
 
Leicester Stadium Kp
Leicester Stadium KpLeicester Stadium Kp
Leicester Stadium Kpdsnith
 
The Benefits and Challenges of Being Connected: Living, Learning, and Teachin...
The Benefits and Challenges of Being Connected: Living, Learning, and Teachin...The Benefits and Challenges of Being Connected: Living, Learning, and Teachin...
The Benefits and Challenges of Being Connected: Living, Learning, and Teachin...Richard Beach
 
Smash - Richard Lavigne
Smash - Richard LavigneSmash - Richard Lavigne
Smash - Richard Lavigneguest6028901
 
Olli oct17 workplace
Olli oct17 workplaceOlli oct17 workplace
Olli oct17 workplaceRichard Beach
 
Lra belshaw discussant
Lra belshaw discussant Lra belshaw discussant
Lra belshaw discussant Richard Beach
 
Creating A Facebook Fan Page
Creating A Facebook  Fan  PageCreating A Facebook  Fan  Page
Creating A Facebook Fan Pagebrandvines
 
Las Maravillas Del Oce Ano 2
Las Maravillas Del Oce Ano 2Las Maravillas Del Oce Ano 2
Las Maravillas Del Oce Ano 2Elkin Rodriguez
 

Viewers also liked (20)

Ek 1552 S Eng
Ek 1552 S EngEk 1552 S Eng
Ek 1552 S Eng
 
Penman - Our PR Process
Penman - Our PR ProcessPenman - Our PR Process
Penman - Our PR Process
 
Strategies for Using LinkedIn
Strategies for Using LinkedInStrategies for Using LinkedIn
Strategies for Using LinkedIn
 
Den attraktiva gymnasieskolan
Den attraktiva gymnasieskolanDen attraktiva gymnasieskolan
Den attraktiva gymnasieskolan
 
오픈소스 프로젝트 올챙이
오픈소스 프로젝트 올챙이오픈소스 프로젝트 올챙이
오픈소스 프로젝트 올챙이
 
Leicester Stadium Kp
Leicester Stadium KpLeicester Stadium Kp
Leicester Stadium Kp
 
The Benefits and Challenges of Being Connected: Living, Learning, and Teachin...
The Benefits and Challenges of Being Connected: Living, Learning, and Teachin...The Benefits and Challenges of Being Connected: Living, Learning, and Teachin...
The Benefits and Challenges of Being Connected: Living, Learning, and Teachin...
 
Howto Facebook
Howto FacebookHowto Facebook
Howto Facebook
 
Eclipse RAP
Eclipse RAPEclipse RAP
Eclipse RAP
 
Smoking jaclyn sweeney
Smoking jaclyn sweeneySmoking jaclyn sweeney
Smoking jaclyn sweeney
 
Smash - Richard Lavigne
Smash - Richard LavigneSmash - Richard Lavigne
Smash - Richard Lavigne
 
Olli oct17 workplace
Olli oct17 workplaceOlli oct17 workplace
Olli oct17 workplace
 
Swt J Face 2/3
Swt J Face 2/3Swt J Face 2/3
Swt J Face 2/3
 
Corporate Pitch 1107
Corporate Pitch 1107Corporate Pitch 1107
Corporate Pitch 1107
 
Lra belshaw discussant
Lra belshaw discussant Lra belshaw discussant
Lra belshaw discussant
 
Creating A Facebook Fan Page
Creating A Facebook  Fan  PageCreating A Facebook  Fan  Page
Creating A Facebook Fan Page
 
Las Maravillas Del Oce Ano 2
Las Maravillas Del Oce Ano 2Las Maravillas Del Oce Ano 2
Las Maravillas Del Oce Ano 2
 
Nk Rock.0
Nk Rock.0Nk Rock.0
Nk Rock.0
 
mediator
mediatormediator
mediator
 
Taking Wi-Fi Where It’s Never Gone Before
Taking Wi-Fi Where It’s Never Gone BeforeTaking Wi-Fi Where It’s Never Gone Before
Taking Wi-Fi Where It’s Never Gone Before
 

Similar to Draw2D

Model-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive TransformationModel-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive TransformationEelco Visser
 
package chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfpackage chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfKARTIKINDIA
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom viewsMu Chun Wang
 
1 How do you create a frame (AWT or swing)How do you set th
1 How do you create a frame (AWT or swing)How do you set th1 How do you create a frame (AWT or swing)How do you set th
1 How do you create a frame (AWT or swing)How do you set thhirstcruz
 
Getting started with GUI programming in Java_1
Getting started with GUI programming in Java_1Getting started with GUI programming in Java_1
Getting started with GUI programming in Java_1Muhammad Shebl Farag
 
What's New in Android
What's New in AndroidWhat's New in Android
What's New in AndroidRobert Cooper
 
Creating an Uber Clone - Part XIX - Transcript.pdf
Creating an Uber Clone - Part XIX - Transcript.pdfCreating an Uber Clone - Part XIX - Transcript.pdf
Creating an Uber Clone - Part XIX - Transcript.pdfShaiAlmog1
 
Average- An android project
Average- An android projectAverage- An android project
Average- An android projectIpsit Dash
 
Jetpack Compose - Hands-on February 2020
Jetpack Compose - Hands-on February 2020Jetpack Compose - Hands-on February 2020
Jetpack Compose - Hands-on February 2020Pedro Veloso
 
Scala+swing
Scala+swingScala+swing
Scala+swingperneto
 
Jetpack Compose a nova forma de implementar UI no Android
Jetpack Compose a nova forma de implementar UI no AndroidJetpack Compose a nova forma de implementar UI no Android
Jetpack Compose a nova forma de implementar UI no AndroidNelson Glauber Leal
 
Value isnt changing and I cant seem to get the conversion to wor.pdf
Value isnt changing and I cant seem to get the conversion to wor.pdfValue isnt changing and I cant seem to get the conversion to wor.pdf
Value isnt changing and I cant seem to get the conversion to wor.pdfamirthagiftsmadurai
 
React new features and intro to Hooks
React new features and intro to HooksReact new features and intro to Hooks
React new features and intro to HooksSoluto
 
Building mobile web apps with Mobello
Building mobile web apps with MobelloBuilding mobile web apps with Mobello
Building mobile web apps with MobelloJeong-Geun Kim
 

Similar to Draw2D (20)

Model-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive TransformationModel-Driven Software Development - Context-Sensitive Transformation
Model-Driven Software Development - Context-Sensitive Transformation
 
Chap1 1 4
Chap1 1 4Chap1 1 4
Chap1 1 4
 
Java swing
Java swingJava swing
Java swing
 
package chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfpackage chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdf
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom views
 
1 How do you create a frame (AWT or swing)How do you set th
1 How do you create a frame (AWT or swing)How do you set th1 How do you create a frame (AWT or swing)How do you set th
1 How do you create a frame (AWT or swing)How do you set th
 
Getting started with GUI programming in Java_1
Getting started with GUI programming in Java_1Getting started with GUI programming in Java_1
Getting started with GUI programming in Java_1
 
What's New in Android
What's New in AndroidWhat's New in Android
What's New in Android
 
Creating an Uber Clone - Part XIX - Transcript.pdf
Creating an Uber Clone - Part XIX - Transcript.pdfCreating an Uber Clone - Part XIX - Transcript.pdf
Creating an Uber Clone - Part XIX - Transcript.pdf
 
Average- An android project
Average- An android projectAverage- An android project
Average- An android project
 
Jetpack Compose - Hands-on February 2020
Jetpack Compose - Hands-on February 2020Jetpack Compose - Hands-on February 2020
Jetpack Compose - Hands-on February 2020
 
Scala+swing
Scala+swingScala+swing
Scala+swing
 
Jetpack Compose a nova forma de implementar UI no Android
Jetpack Compose a nova forma de implementar UI no AndroidJetpack Compose a nova forma de implementar UI no Android
Jetpack Compose a nova forma de implementar UI no Android
 
Value isnt changing and I cant seem to get the conversion to wor.pdf
Value isnt changing and I cant seem to get the conversion to wor.pdfValue isnt changing and I cant seem to get the conversion to wor.pdf
Value isnt changing and I cant seem to get the conversion to wor.pdf
 
Awt
AwtAwt
Awt
 
Jp notes
Jp notesJp notes
Jp notes
 
React new features and intro to Hooks
React new features and intro to HooksReact new features and intro to Hooks
React new features and intro to Hooks
 
Chap1 1.4
Chap1 1.4Chap1 1.4
Chap1 1.4
 
Building mobile web apps with Mobello
Building mobile web apps with MobelloBuilding mobile web apps with Mobello
Building mobile web apps with Mobello
 
Android 3
Android 3Android 3
Android 3
 

More from cho hyun jong

평범한 개발자 오픈소스로 먹고살기 2
평범한 개발자 오픈소스로 먹고살기 2평범한 개발자 오픈소스로 먹고살기 2
평범한 개발자 오픈소스로 먹고살기 2cho hyun jong
 
테드폴허브(올챙이) PostgreSQL 디비 확장하기
테드폴허브(올챙이) PostgreSQL 디비 확장하기테드폴허브(올챙이) PostgreSQL 디비 확장하기
테드폴허브(올챙이) PostgreSQL 디비 확장하기cho hyun jong
 
평범한 개발자 오픈소스로 먹고살기 2
평범한 개발자 오픈소스로 먹고살기 2평범한 개발자 오픈소스로 먹고살기 2
평범한 개발자 오픈소스로 먹고살기 2cho hyun jong
 
자바가 디비와 사귀기 까지 벌어지는 일들
자바가 디비와 사귀기 까지 벌어지는 일들자바가 디비와 사귀기 까지 벌어지는 일들
자바가 디비와 사귀기 까지 벌어지는 일들cho hyun jong
 
테드폴허브 오픈소스Vs엔터프라이즈
테드폴허브 오픈소스Vs엔터프라이즈테드폴허브 오픈소스Vs엔터프라이즈
테드폴허브 오픈소스Vs엔터프라이즈cho hyun jong
 
올챙이팜플렛 V1.0
올챙이팜플렛 V1.0올챙이팜플렛 V1.0
올챙이팜플렛 V1.0cho hyun jong
 
올챙이팜플렛
올챙이팜플렛올챙이팜플렛
올챙이팜플렛cho hyun jong
 
Tadpole db hub-monitoring
Tadpole db hub-monitoring Tadpole db hub-monitoring
Tadpole db hub-monitoring cho hyun jong
 
올챙이 확장으로 살펴보는 이클립스 확장
올챙이 확장으로 살펴보는 이클립스 확장올챙이 확장으로 살펴보는 이클립스 확장
올챙이 확장으로 살펴보는 이클립스 확장cho hyun jong
 
Eclipse basic(조현종)
Eclipse basic(조현종)Eclipse basic(조현종)
Eclipse basic(조현종)cho hyun jong
 
Tadpole DB Hub 1.0.0
Tadpole DB Hub 1.0.0Tadpole DB Hub 1.0.0
Tadpole DB Hub 1.0.0cho hyun jong
 
올챙이(Tadpole for DB Tools)로 살펴보는 Eclipse RAP
올챙이(Tadpole for DB Tools)로 살펴보는 Eclipse RAP올챙이(Tadpole for DB Tools)로 살펴보는 Eclipse RAP
올챙이(Tadpole for DB Tools)로 살펴보는 Eclipse RAPcho hyun jong
 
올챙이 현재와 미래
올챙이 현재와 미래올챙이 현재와 미래
올챙이 현재와 미래cho hyun jong
 
올챙이로 살펴보는 Eclipse개발
올챙이로 살펴보는 Eclipse개발올챙이로 살펴보는 Eclipse개발
올챙이로 살펴보는 Eclipse개발cho hyun jong
 
올챙이로 살펴보는 개발툴과 Cloud
올챙이로 살펴보는 개발툴과 Cloud올챙이로 살펴보는 개발툴과 Cloud
올챙이로 살펴보는 개발툴과 Cloudcho hyun jong
 
Eclipse RAP - Single Source
Eclipse RAP - Single SourceEclipse RAP - Single Source
Eclipse RAP - Single Sourcecho hyun jong
 
Petra보고서 개발 open자료
Petra보고서 개발 open자료Petra보고서 개발 open자료
Petra보고서 개발 open자료cho hyun jong
 

More from cho hyun jong (20)

평범한 개발자 오픈소스로 먹고살기 2
평범한 개발자 오픈소스로 먹고살기 2평범한 개발자 오픈소스로 먹고살기 2
평범한 개발자 오픈소스로 먹고살기 2
 
테드폴허브(올챙이) PostgreSQL 디비 확장하기
테드폴허브(올챙이) PostgreSQL 디비 확장하기테드폴허브(올챙이) PostgreSQL 디비 확장하기
테드폴허브(올챙이) PostgreSQL 디비 확장하기
 
평범한 개발자 오픈소스로 먹고살기 2
평범한 개발자 오픈소스로 먹고살기 2평범한 개발자 오픈소스로 먹고살기 2
평범한 개발자 오픈소스로 먹고살기 2
 
자바가 디비와 사귀기 까지 벌어지는 일들
자바가 디비와 사귀기 까지 벌어지는 일들자바가 디비와 사귀기 까지 벌어지는 일들
자바가 디비와 사귀기 까지 벌어지는 일들
 
테드폴허브 오픈소스Vs엔터프라이즈
테드폴허브 오픈소스Vs엔터프라이즈테드폴허브 오픈소스Vs엔터프라이즈
테드폴허브 오픈소스Vs엔터프라이즈
 
올챙이팜플렛 V1.0
올챙이팜플렛 V1.0올챙이팜플렛 V1.0
올챙이팜플렛 V1.0
 
올챙이팜플렛
올챙이팜플렛올챙이팜플렛
올챙이팜플렛
 
Tadpole db hub-monitoring
Tadpole db hub-monitoring Tadpole db hub-monitoring
Tadpole db hub-monitoring
 
올챙이 확장으로 살펴보는 이클립스 확장
올챙이 확장으로 살펴보는 이클립스 확장올챙이 확장으로 살펴보는 이클립스 확장
올챙이 확장으로 살펴보는 이클립스 확장
 
Swt bot
Swt botSwt bot
Swt bot
 
Eclipse basic(조현종)
Eclipse basic(조현종)Eclipse basic(조현종)
Eclipse basic(조현종)
 
Tadpole DB Hub 1.0.0
Tadpole DB Hub 1.0.0Tadpole DB Hub 1.0.0
Tadpole DB Hub 1.0.0
 
올챙이(Tadpole for DB Tools)로 살펴보는 Eclipse RAP
올챙이(Tadpole for DB Tools)로 살펴보는 Eclipse RAP올챙이(Tadpole for DB Tools)로 살펴보는 Eclipse RAP
올챙이(Tadpole for DB Tools)로 살펴보는 Eclipse RAP
 
올챙이 현재와 미래
올챙이 현재와 미래올챙이 현재와 미래
올챙이 현재와 미래
 
올챙이로 살펴보는 Eclipse개발
올챙이로 살펴보는 Eclipse개발올챙이로 살펴보는 Eclipse개발
올챙이로 살펴보는 Eclipse개발
 
올챙이로 살펴보는 개발툴과 Cloud
올챙이로 살펴보는 개발툴과 Cloud올챙이로 살펴보는 개발툴과 Cloud
올챙이로 살펴보는 개발툴과 Cloud
 
Eclipse RAP design
Eclipse RAP designEclipse RAP design
Eclipse RAP design
 
WindowTester PRO
WindowTester PROWindowTester PRO
WindowTester PRO
 
Eclipse RAP - Single Source
Eclipse RAP - Single SourceEclipse RAP - Single Source
Eclipse RAP - Single Source
 
Petra보고서 개발 open자료
Petra보고서 개발 open자료Petra보고서 개발 open자료
Petra보고서 개발 open자료
 

Recently uploaded

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Recently uploaded (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Draw2D

  • 1. Eclipse Draw2D ECLIPSE DRAW2D 조현종(v.05, 12/12/09) http://cafe.naver.com/eclipseplugin http://hangumkj.blogspot.com/ hangum@gmail.com
  • 2. 목 차  Draw2D란?  Draw2D 살펴보기  실행 환경  HelloWorld Draw2D  Figures 종류  Painting of Figures  Layout  Locator Anchors Routers  실습
  • 3. Draw2D란?  그래픽 생성, 편집, 조작가능  SWT에 의존  경량 Widget  www.eclipse.org/gef
  • 4. Draw2D 살펴보기  LightweightSystem?  SWT Canvas와 Draw2D를 연결 .  SWT Control 위에서 발생한 이벤트를 Draw2D이 벤트로 변경  SWT의 Display와 비슷한 역할을 함
  • 5. Draw2D 살펴보기  EventDispatcher?  SWT Event to Draw2D router  UpdateManager?
  • 6. Draw2D 살펴보기  Figure?  Draw2D에서 표현 되어 지는 것.  반드시 하나의 Root Figure가 존재해야함.  부모 자식과의 관계가 가능 하며, 마우스 이벤트 등의 이벤트 가능  SWT의 Shell, Control, Composite등과 비슷함. Class는 org.eclipse.draw2d.IFigurer
  • 7. 실행환경  Eclipse 4.2 SR1  GEF SDK3.8.1 (update manager http://download.eclipse.org/tools/gef/updates/releases/)
  • 8. HelloWorld Draw2D . ps) com.ibm.icu?? 추가하세요
  • 9. Figure  Figure?  Draw2D에서 표현 되어 지는 것.  반드시 하나의 Root Figure가 존재해야함.  부모 자식과의 관계가 가능 하며, 마우스 이벤트 등의 이벤트 가능  SWT의 Shell, Control, Composite등과 비슷함. Class는 org.eclipse.draw2d.IFigurer
  • 10. Figure – Common Figures  Shapes – rectangle, triangles, ellipse  Clickables – buttons, checkboxes  Containers – Panel, ScrollPane  Connections – figure간의 line  Layered – figure 들을 layer  Other – ImageFigure, Label등
  • 12. Figure Border  CompoundBorder  FramBorder  GroupBoxBorder  LineBorder  SimpleEtchedBorder  SimpleLoweredBorder  SimpleRaisedBorder  TitleBarBorder
  • 13. Figures Z-Order  Figures들은 tree형식을 취합니다  (Root Figure 존재)  자식 Figure를 만들 수 있고, 부모와 자식 관 계를 가집니다  마지막에 그린 것이 제일위에 표시됩니다.
  • 14. Event Listener Description FocusListener 포커스를 얻거나 잃었을때 KeyListener MouseListener Mouse 클릭, 클릭 후, 버블클릭 MouseMotionListener Mouse 가 움직일때 (mouse enter, mouse hover, mouse move)
  • 15. Genealogy 예제  Figure  RectangleFigure  PolygonShape  PolylineConnection  ChopboxAnchor  Event  MouseListener  MouseMotionListener
  • 17. BorderLayout Canvas canvas = new Canvas(parent, SWT.NONE); LightweightSystem lws = new LightweightSystem(canvas); IFigure panel = new Figure(); BorderLayout layout = new BorderLayout(); panel.setLayoutManager(layout); Button btnLeft = new Button("Left Button"); panel.setBorder(new LineBorder()); panel.add(btnLeft, BorderLayout.LEFT); Button btnRight = new Button("right Button"); panel.setBorder(new LineBorder()); panel.add(btnRight, BorderLayout.RIGHT); Button btnTOP = new Button("TOP Button"); panel.setBorder(new LineBorder()); panel.add(btnTOP, BorderLayout.TOP); lws.setContents(panel);
  • 18. FlowLayout Canvas canvas = new Canvas(parent, SWT.NONE); LightweightSystem lws = new LightweightSystem(canvas); IFigure panel = new Figure(); FlowLayout layout = new FlowLayout(); layout.setHorizontal(true); panel.setLayoutManager(layout); for (int i = 0; i < 10; i++) { panel.add(new Button("button" + i)); } lws.setContents(panel);
  • 19. XYLayout Canvas canvas = new Canvas(parent, SWT.NONE); LightweightSystem lws = new LightweightSystem(canvas); IFigure panel = new Figure(); XYLayout layout = new XYLayout(); panel.setLayoutManager(layout); Button btn = new Button("btn"); Rectangle rect = new Rectangle(10, 10, 50, 50); panel.add(btn); panel.setConstraint(btn, rect); lws.setContents(panel);
  • 20. ToolbarLayout Canvas canvas = new Canvas(parent, SWT.NONE); LightweightSystem lws = new LightweightSystem(canvas); IFigure panel = new Figure(); ToolbarLayout layout = new ToolbarLayout(); layout.setVertical(true); panel.setLayoutManager(layout); for (int i = 0; i < 10; i++) { panel.add(new Button("button" + i)); } lws.setContents(panel);
  • 21. ParagraphTextLayout private TextFlow makeTextFlow(String text) { TextFlow textFlow = new TextFlow(); textFlow.setLayoutManager(new ParagraphTextLayout(textFlow, ParagraphTextLayout.WORD_WRAP_HARD)); textFlow.setFont(this.getFont()); textFlow.setText("rn"+text); return textFlow; }
  • 22. Connections  Anchors : Figure간의 선 연결  Decorations : 선의 끝을 장식  Routers : 선의 방향을 어떻게 할 것인지~  Locator : 텍스트를 선의 어느 위치에 놓을 것인지~
  • 23. Anchors  figure들 간에 선 연결  ChopboxAnchor  EllipseAnchor  LabelAnchor  XYAnchor
  • 24. Decorations  선의 끝 모양을 장식  Default Decorations  PolylineDecoration  PolygonDecoration  RotatableDecoration
  • 25. Routers  Router  NullConnectionRouter  BendpointConnectionRouter  MantattanConnectionRouter
  • 26. Router  BendpointConnectionRouter  AbsoluteBendpoint : 절대 좌표 리턴  AbsoluteBendpoint(350, 10);  RelativeBendpoint :  RelativeBendpoint bp2 = new RelativeBendpoint(firstConnection);  bp2.setRelativeDimensions(new Dimension(-50, 20), new Dimension(10, -40));
  • 27. Connection Labels(Locator) Locator 이 름 종 류 BendpointLocator BendpointConnectionRoutter의 텍스트 ConnectionEndpointLocator 선의 양끝 텍스트 MidpointLocator 선의 중앙 텍스트 ConnectionLocator RelativeLocator
  • 28. PolylineConnection ManhattanConnectionRouter PolylineConnection connection = new PolylineConnection(); .. // source label decoration ConnectionEndpointLocator locator = new ConnectionEndpointLocator (connection, false); Label label = new Label("Source"); connection.add(label, locator); // target label decoration locator = new ConnectionEndpointLocator (connection, true); label = new Label("Target"); connection.add(label, locator); // ManhattanConnectionRouter router = new ManhattanConnectionRouter (); connection.setConnectionRouter (router); // rootFigure에 추가합니다. rootFigure.add(connection);
  • 30. 참고자료  Addison Wesely The Eclipse Graphical Editing Framework  Eclipse Help(http://help.eclipse.org/ganymede/index.jsp) – Draw2D  Eclipse coon 2005 GEF in dept ppt  SWT/Jface 인 액션(이선아/제갈호준/에이콘)  http://www13.plala.or.jp/observe/draw2d/draw2d_overview.html  Eclipse Plug-in & RCP café의 번역문  http://eclipse-articles.springnote.com/pages/3666185  http://eclipse-articles.springnote.com/pages/3683263  http://eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2d.html  Eclipse Development using the Graphical Editing Framework and the Eclipse Modeling Framework(IBM)