Gridarta Editor
Help.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2023 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.gui.dialog.help;
21 
22 import java.awt.Container;
23 import java.awt.Frame;
24 import java.awt.Rectangle;
25 import javax.swing.JDialog;
26 import net.sf.japi.swing.action.DisposeAction;
27 import org.jetbrains.annotations.NotNull;
28 
41 @Deprecated
42 public class Help extends JDialog {
43 
47  private static final long serialVersionUID = 1L;
48 
59  public Help(@NotNull final Frame parent, @NotNull final String fileName) {
60  super(parent, "Help", false); // super constructor
61  setResizable(true);
62 
63  final Rectangle mvb = parent.getBounds(); // get main view bounds
64  setBounds(mvb.x + mvb.width / 2 - 260, mvb.y + 70, 520, 600); // standard
65 
66  final Container html;
67  if (fileName.startsWith("<HTML>") || fileName.startsWith("<html>")) {
68  html = new HtmlPane("text/html", fileName); // direct text
69  } else {
70  html = new HtmlPane(fileName); // read html file
71  }
72  DisposeAction.install(this);
73  setContentPane(html);
74  setDefaultCloseOperation(DISPOSE_ON_CLOSE);
75  }
76 
77 }
net.sf
net.sf.gridarta.gui.dialog.help.Help
Implements the Help Window is a separate frame with html content.
Definition: Help.java:42
net
net.sf.gridarta.gui.dialog.help.HtmlPane
Pane for displaying HTML.
Definition: HtmlPane.java:46
net.sf.gridarta.gui.dialog.help.Help.Help
Help(@NotNull final Frame parent, @NotNull final String fileName)
Creates a "Help".
Definition: Help.java:59
net.sf.gridarta.gui.dialog.help.Help.serialVersionUID
static final long serialVersionUID
Serial Version UID.
Definition: Help.java:47