me.escapeNT.pail
Class Pail

java.lang.Object
  extended by org.bukkit.plugin.java.JavaPlugin
      extended by me.escapeNT.pail.Pail
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.plugin.Plugin

public final class Pail
extends org.bukkit.plugin.java.JavaPlugin

Independent, comprehensive, and extensible GUI for Bukkit.

Author:
escapeNT

Nested Class Summary
 class Pail.InitMain
           
 
Field Summary
static ServerReadyListener handler
           
 Image PAIL_ICON
           
static String PLUGIN_NAME
           
static String PLUGIN_THREAD
           
static String PLUGIN_VERSION
           
 me.escapeNT.pail.Pail.WindowCloseListener windowListener
           
 
Constructor Summary
Pail()
           
 
Method Summary
 void addWaypoint(Waypoint waypoint)
          Add the provided Waypoint to the list.
 ImageIcon getIcon(org.bukkit.Material material)
          Gets the 25x25 pixel image icon for the provided Material.
 JPanel getInterfaceComponent(String title)
          Gets the interface component by the specified title, or null if it isn't loaded.
 Language getLanguage()
          Gets the currently selected language.
 MainWindow getMainWindow()
          Returns the main window of this instance.
 Waypoint getWaypoint(String name)
          Gets the waypoint with the specified name, or null if it doesn't exist.
 void loadInterfaceComponent(String title, JPanel panel)
          Loads the provided JPanel into the user interface under the given title.
protected  void loadState()
          Attempts to load a previous state from file (if it exists).
 boolean onCommand(org.bukkit.command.CommandSender sender, org.bukkit.command.Command cmd, String commandLabel, String[] args)
           
 void onDisable()
           
 void onEnable()
           
 boolean removeWaypoint(String name)
          Removes the waypoint with the given name from the list.
 void saveState()
          Saves the current plugin state to file.
 void setActivated(String title, boolean activated)
          Sets the activated (visible) status of the specified tab.
 String translate(String text)
          Translates the given text to the currently selected language.
 
Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfiguration, getDatabase, getDatabaseClasses, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getPluginLoader, getServer, initialize, installDDL, isEnabled, isInitialized, isNaggable, onLoad, removeDDL, setEnabled, setNaggable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PAIL_ICON

public final Image PAIL_ICON

PLUGIN_NAME

public static String PLUGIN_NAME

PLUGIN_THREAD

public static String PLUGIN_THREAD

PLUGIN_VERSION

public static String PLUGIN_VERSION

handler

public static final ServerReadyListener handler

windowListener

public final me.escapeNT.pail.Pail.WindowCloseListener windowListener
Constructor Detail

Pail

public Pail()
Method Detail

onEnable

public void onEnable()

onDisable

public void onDisable()

onCommand

public boolean onCommand(org.bukkit.command.CommandSender sender,
                         org.bukkit.command.Command cmd,
                         String commandLabel,
                         String[] args)
Specified by:
onCommand in interface org.bukkit.command.CommandExecutor
Overrides:
onCommand in class org.bukkit.plugin.java.JavaPlugin

saveState

public void saveState()
Saves the current plugin state to file.


loadState

protected void loadState()
Attempts to load a previous state from file (if it exists).


getMainWindow

public MainWindow getMainWindow()
Returns the main window of this instance.

Returns:
the main

loadInterfaceComponent

public void loadInterfaceComponent(String title,
                                   JPanel panel)
Loads the provided JPanel into the user interface under the given title. If the title is null, it will be converted to the empty String.

Parameters:
panel - The JPanel to load.
title - The title of this panel.
Throws:
NullPointerException - if the specified JPanel is null.
IllegalArgumentException - if the title is already taken.

getInterfaceComponent

public JPanel getInterfaceComponent(String title)
Gets the interface component by the specified title, or null if it isn't loaded.

Parameters:
title - The title of the component.
Returns:
The component loaded with the specified title, or null if it doesn't exist.

setActivated

public void setActivated(String title,
                         boolean activated)
Sets the activated (visible) status of the specified tab. Note: this will refresh the tab layout to reflect changes immediately.

Parameters:
title - The title of the panel.
activated - True if the tab will be visible.

getWaypoint

public Waypoint getWaypoint(String name)
Gets the waypoint with the specified name, or null if it doesn't exist.

Parameters:
name - The name of the waypoint.
Returns:

addWaypoint

public void addWaypoint(Waypoint waypoint)
Add the provided Waypoint to the list.

Parameters:
waypoint - The Waypoint to add.

removeWaypoint

public boolean removeWaypoint(String name)
Removes the waypoint with the given name from the list.

Parameters:
name - The name of the Waypoint to remove.
Returns:
True if a waypoint was indeed removed.

getLanguage

public Language getLanguage()
Gets the currently selected language.

Returns:
The Language selected.

translate

public String translate(String text)
Translates the given text to the currently selected language.

Parameters:
text - The text to translate.
Returns:
the translated text, or the original text if English is the currently selected language.

getIcon

public ImageIcon getIcon(org.bukkit.Material material)
Gets the 25x25 pixel image icon for the provided Material.

Parameters:
material - The material to get the icon for.
Returns:
The 25x25px ImageIcon of the provided material.
Throws:
IllegalArgumentException - if the Material is AIR.


Copyright © 2011. All Rights Reserved.