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

Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
Rebecca Murphey
 

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

Penman - Our PR Process
Penman - Our PR ProcessPenman - Our PR Process
Penman - Our PR Process
pdhill
 
Smash - Richard Lavigne
Smash - Richard LavigneSmash - Richard Lavigne
Smash - Richard Lavigne
guest6028901
 
Lra belshaw discussant
Lra belshaw discussant Lra belshaw discussant
Lra belshaw discussant
Richard Beach
 

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

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
KARTIKINDIA
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom views
Mu 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 th
hirstcruz
 
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
Muhammad Shebl Farag
 
Average- An android project
Average- An android projectAverage- An android project
Average- An android project
Ipsit Dash
 
Scala+swing
Scala+swingScala+swing
Scala+swing
perneto
 
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
amirthagiftsmadurai
 

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
평범한 개발자 오픈소스로 먹고살기 2
cho hyun jong
 
올챙이팜플렛 V1.0
올챙이팜플렛 V1.0올챙이팜플렛 V1.0
올챙이팜플렛 V1.0
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.0
cho 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

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
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
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 New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
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...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

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)