//***************************************************************************** // Copyright (c) 1998 INRIA. // http://www.inria.fr/croap/aioli/modules/figue/web/credits.html#COPYRIGHT //***************************************************************************** package figue.tutorial; import java.awt.GridLayout; import figue.*; import figue.box.*; import figue.path.*; import figue.resource.*; public final class Tutorial_18 extends TutorialApplet { /** * For code identification with unix what command. * @level internal */ public final static String VERSION_ID = "@(#) $Source: /net/croap/CVSROOT/figue/java/tutorial/Tutorial_18.java,v $ $revision$ $Date: 1998/11/02 15:55:51 $ Copyright 1998 INRIA."; protected final void initTutorial() { setLayout(new GridLayout(1,1)); _facade = new AWTFacade(getParameters()); add(_facade.getAwtComponent()); setDefaultKeyListener(_facade); initResources(); buildBox(); } public final void destroy() { _facade.disposeWhenInactive(); _facade = null; super.destroy(); } private final FacadeInitializer getParameters() { FacadeInitializer theParameters = new FacadeInitializer(); theParameters.setFormattingWidth(475); theParameters.setInitialColor("My color"); theParameters.setInitialBackground("My background"); theParameters.setInitialFont("My font"); setAppletParameters(theParameters); return theParameters; } private final void initResources() { try { _facade.doGetFont("My font",FontFamily.TIMES_ROMAN,FontStyle.BOLD_ITALIC,24,false); _facade.doGetColor("My background",BasicColor.RED); _facade.doGetColor("My color",BasicColor.YELLOW); } catch ( WrongResourceException anException ) { ; } initStandardResources(_facade); } private final void buildBox() { final GlyphInterface theLine = new Horizontal(15); theLine.addChild(Atom.newAtom("It's")); theLine.addChild(Atom.newAtom('a')); theLine.addChild(Atom.newAtom("wonderful")); theLine.addChild(Atom.newAtom("life")); theLine.addChild(Atom.newAtom("!!")); PathInterface thePath = new Path(); thePath.addOperation(new InsertGlyph(theLine,0)); _facade.buildInit(thePath); _facade.buildComplete(); } private AWTFacade _facade; }