ReuseTool Auxiliando o Processo de Instanciação. Processo de Instanciação 2010Frameworks2.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advanced Piloting Cruise Plot.
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 5 Author: Julia Richards and R. Scott Hawley.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
and 6.855J Spanning Tree Algorithms. 2 The Greedy Algorithm in Action
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Addition Facts
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
2010 fotografiert von Jürgen Roßberg © Fr 1 Sa 2 So 3 Mo 4 Di 5 Mi 6 Do 7 Fr 8 Sa 9 So 10 Mo 11 Di 12 Mi 13 Do 14 Fr 15 Sa 16 So 17 Mo 18 Di 19.
Richmond House, Liverpool (1) 26 th January 2004.
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
ABC Technology Project
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
VOORBLAD.
15. Oktober Oktober Oktober 2012.
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
1 public class Newton { public static double sqrt(double c) { double epsilon = 1E-15; if (c < 0) return Double.NaN; double t = c; while (Math.abs(t - c/t)
“Start-to-End” Simulations Imaging of Single Molecules at the European XFEL Igor Zagorodnov S2E Meeting DESY 10. February 2014.
Object-Oriented Programming. 2 An object, similar to a real-world object, is an entity with certain properties, and with the ability to react in certain.
BIOLOGY AUGUST 2013 OPENING ASSIGNMENTS. AUGUST 7, 2013  Question goes here!
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Chapter 5 Microsoft Excel 2007 Window
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Slippery Slope
H to shape fully developed personality to shape fully developed personality for successful application in life for successful.
Presenteren wij ………………….
Januar MDMDFSSMDMDFSSS
Week 1.
Analyzing Genes and Genomes
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Figure Essential Cell Biology (© Garland Science 2010)
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
VPN AND REMOTE ACCESS Mohammad S. Hasan 1 VPN and Remote Access.
Immunobiology: The Immune System in Health & Disease Sixth Edition
Essential Cell Biology
How Cells Obtain Energy from Food
Immunobiology: The Immune System in Health & Disease Sixth Edition
Energy Generation in Mitochondria and Chlorplasts
CpSc 3220 Designing a Database
Presentation transcript:

ReuseTool Auxiliando o Processo de Instanciação

Processo de Instanciação 2010Frameworks2

Cenário

Framework

Aplicação

Modelo

Código I 1.package org.eclipse.gef.examples.shapes.mymodel 2./** 3. * A crazy shape. 4. Toacy Oliveira 5. */ 6.public class CrazyShape extends Shape { 7./** A 16x16 pictogram of a crazy shape. */ 8.private static final Image CRAZY_ICON = createImage("icons/crazy16.gif"); 9.private static final long serialVersionUID = 1; 10.public Image getIcon() { 11.return CRAZY_ICON; 12.} 13.public String toString() { 14.return "Crazy " + hashCode(); 15.} 16.public IFigure getFigure() { return new CrazyFigure ("Pop"); 19.} 20.public ConnectionAnchor getConnectionAnchor(IFigure iFigure) { 21.return new ChopboxAnchor(iFigure); 22.} 23.public boolean canConnect(Shape target) { 24.return (super.canConnect(target)) && !(target instanceof RectangularShape); 25.} 26.}

Código II 1.package org.eclipse.gef.examples.shapes.myfigures; 2.public class CrazyFigure extends RoundedRectangle { 3.public CrazyFigure(String name) { 4.super(); 5.ToolbarLayout layout = new ToolbarLayout(); 6.setLayoutManager(layout); 7.setBorder(new LineBorder(ColorConstants.black, 1)); 8.setBackgroundColor(ColorConstants.red); 9.setForegroundColor(ColorConstants.yellow); 10.setOpaque(true); 11.Label l = new Label("Crazy!" + name); 12.l.setForegroundColor(ColorConstants.red); 13.l.setBackgroundColor(ColorConstants.blue); 14.l.setFont(new Font(null, "Arial", 20, SWT.BOLD)); 15.l.setBorder(new LineBorder(ColorConstants.black, 2)); 16.add(l); 17.} 18.public void paintFigure(Graphics graphics) { 19.super.paintFigure(graphics); 20.graphics.setForegroundColor(ColorConstants.orange); 21.graphics.setLineStyle(Graphics.LINE_SOLID); 22.graphics.setLineWidth(3); 23.Rectangle r = getBounds(); 24.graphics.drawLine(new Point(r.x + r.width / 2, r.y + r.height * 0.3), 25.new Point(r.x + r.width / 2, r.y + r.height * 0.7)); 26.// horizontal line 27.graphics.drawLine(new Point(r.x + r.width * 0.3, r.y + r.height / 2), 28.new Point(r.x + r.width * 0.7, r.y + r.height / 2)); 29.}; 30.}

Hotspots Configurando a Forma – Ícones – Aparência – Conexões Alterando a Palette – Inserindo novo elemento na Palette

Reuse Description Language

A Solução RDL COOKBOOK ShapesProducts RECIPE main{ packA = NEW_PACKAGE(FrameworkModel,"org.reusetool.example.myshapeseditor"); LOOP ("Create another shape?") { // PREPARE Images EXTERNAL_TASK("Define 16x16 icon"); EXTERNAL_TASK("Define 24x24 icon"); // Define Shape SubClass shapeClass = CLASS_EXTENSION(Shape, packA,"?"); // Refine Abstract Methods m = METHOD_EXTENSION(Shape,shapeClass,addConnectionAnchor); ADD_CODE(shapeClass,m,"return new ChopboxAnchor(iFigure);"); m = METHOD_EXTENSION(Shape,shapeClass,getFigure); ADD_CODE(shapeClass,m,"return new IFIGURE_SUBCLASS);"); m = METHOD_EXTENSION(Shape,shapeClass,getIcon); ADD_CODE(shapeClass,m,"return createImage(\"NEW_SHAPE.gif\");"); // Configure Palette ADD_CODE(ShapesEditorPaletteFactory,createShapesDrawer, "component = new CombinedTemplateCreationEntry( \"NEW_SHAPE\", \"Create a NEW_SHAPE shape\", NEW_SHAPE.class, new SimpleFactory(NEW_SHAPE.class), ImageDescriptor.createFromFile(ShapesPlugin.class, \"icons/crazy16.gif\"), ImageDescriptor.createFromFile(ShapesPlugin.class, \"icons/crazy24.gif\")); componentsDrawer.add(component); "); // Redefine Method to treat How Connections can be handled IF ("Add Feature - Restrict Connections?") THEN { m = METHOD_EXTENSION(Shape,shapeClass,canConnect); ADD_CODE(shapeClass,m,"Code that checks if the connection can be made."); } IF ("Add Feature - New Figure?") THEN{ // Define Shape SubClass figClass = CLASS_EXTENSION(Figure, packA,"?"); m = METHOD_EXTENSION(Figure,figClass,paintFigure); } END_COOKBOOK