/** * Create a new CreatureDetailsWindow displaying details for the specified Creature. * * @param creature the Creature to show details for */ public CreatureDetailsWindow(Creature creature) { this.creature = creature; creature.addViewer(this); this.setSize(280, 300); this.setTitle("Details for " + creature.getTemplate().getName()); DialogLayout layout = new DialogLayout(); layout.setTheme("content"); this.add(layout); // set up the widgets for the top row Widget viewer = new Viewer(); viewer.setTheme("iconviewer"); Label title = new Label(creature.getTemplate().getName()); title.setTheme("titlelabel"); DialogLayout.Group topRowV = layout.createParallelGroup(viewer, title); DialogLayout.Group topRowH = layout.createSequentialGroup(viewer); topRowH.addGap(10); topRowH.addWidget(title); topRowH.addGap(10); // create widgets for details text area textAreaModel = new HTMLTextAreaModel(); TextArea textArea = new TextArea(textAreaModel); ScrollPane textPane = new ScrollPane(textArea); textPane.setFixed(ScrollPane.Fixed.HORIZONTAL); textPane.setTheme("detailspane"); // set the main top level layout Group mainGroupV = layout.createSequentialGroup(); mainGroupV.addGroup(topRowV); mainGroupV.addGap(5); mainGroupV.addWidget(textPane); Group mainGroupH = layout.createParallelGroup(); mainGroupH.addGroup(topRowH); mainGroupH.addWidget(textPane); layout.setHorizontalGroup(mainGroupH); layout.setVerticalGroup(mainGroupV); entityUpdated(creature); }