//***************************************************************************** // 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_6 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_6.java,v $ $revision$ $Date: 1998/11/02 15:55:59 $ 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 void buildBox() { final GlyphInterface theParagraph = new Paragraph(5,50,5); for ( int theRank = 0; theRank < 100; theRank++ ) { theParagraph.addChild(Atom.newAtom("It's")); theParagraph.addChild(Atom.newAtom('a')); theParagraph.addChild(Atom.newAtom("wonderful")); theParagraph.addChild(Atom.newAtom("life")); theParagraph.addChild(Atom.newAtom("!!")); } PathInterface thePath = new Path(); thePath.addOperation(new InsertGlyph(theParagraph,0)); _facade.buildInit(thePath); _facade.buildComplete(); } private final void initResources() { try { _facade.doGetFont(Constants.DEFAULT_FONT,FontFamily.TIMES_ROMAN,FontStyle.PLAIN,15,false); _facade.doGetColor(Constants.DEFAULT_COLOR,BasicColor.BLUE); _facade.doGetColor(Constants.DEFAULT_BACKGROUND,BasicColor.WHITE); } catch ( WrongResourceException anException ) { ; } initStandardResources(_facade); } private final FacadeInitializer getParameters() { FacadeInitializer theParameters = new FacadeInitializer(); theParameters.setFormattingWidth(500); setAppletParameters(theParameters); return theParameters; } private AWTFacade _facade; }