Permalink
Browse files

Full refactoring of Nifty

 - Applied JSR-305 annotations
 - Fixed potential null problems
 - Got rid of most Null-Objects
 - Implemented enum related storage system
   -> Mainly used for EffectEventId related storages
 - Got rid of Hashtables
 - Added early checks for problems
 - Added a lot of additional log warnings
 - Formatted code to meet Nifty specifications
 - Implemented proper use of XmlPullParserFactory
 - Fixed ID bug
  • Loading branch information...
mkaring committed Dec 25, 2013
1 parent 617df99 commit bd08f8ce208a2b8e626d1e5f467beb016ac93360
Showing 1,015 changed files with 33,653 additions and 28,233 deletions.
@@ -1,46 +1,47 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>lessvoid</groupId>
- <artifactId>nifty-main</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- </parent>
- <artifactId>nifty-style-black</artifactId>
- <name>Nifty Controls Style Definition (Black)</name>
- <url>http://nifty-gui.sourceforge.net/nifty-style-black/project-info.html</url>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.0.4</version>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.1.2</version>
- <reportSets>
- <reportSet>
- <reports>
- <report>index</report>
- <report>summary</report>
- <report>dependencies</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- </plugins>
- </reporting>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>lessvoid</groupId>
+ <artifactId>nifty-main</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>nifty-style-black</artifactId>
+ <name>Nifty Controls Style Definition (Black)</name>
+ <url>http://nifty-gui.sourceforge.net/nifty-style-black/project-info.html</url>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.0.4</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.1.2</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>index</report>
+ <report>summary</report>
+ <report>dependencies</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
@@ -1,27 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
-<nifty-styles xmlns="http://nifty-gui.lessvoid.com/nifty-gui">
+<nifty-styles xmlns="http://nifty-gui.lessvoid.com/nifty-gui">
- <!-- +++++++++++++++++++++++++++++++++++++ -->
- <!-- style for the button background panel -->
- <!-- +++++++++++++++++++++++++++++++++++++ -->
- <style id="nifty-button#panel">
- <attributes backgroundImage="button/button.png" imageMode="sprite-resize:100,23,0,2,96,2,2,2,96,2,19,2,96,2,2" paddingLeft="7px" paddingRight="7px" width="100px" height="23px" childLayout="center" visibleToMouse="true" />
- <effect>
- <onHover name="border" color="#822f" post="true" />
- <onFocus name="imageOverlay" filename="button/button.png" imageMode="sprite-resize:100,23,1,2,96,2,2,2,96,2,19,2,96,2,2" post="true" />
- <onEnabled name="renderQuad" startColor="#2228" endColor="#2220" post="true" length="150" />
- <onDisabled name="renderQuad" startColor="#2220" endColor="#2228" post="true" length="150" />
- </effect>
- </style>
+ <!-- +++++++++++++++++++++++++++++++++++++ -->
+ <!-- style for the button background panel -->
+ <!-- +++++++++++++++++++++++++++++++++++++ -->
+ <style id="nifty-button#panel">
+ <attributes backgroundImage="button/button.png" imageMode="sprite-resize:100,23,0,2,96,2,2,2,96,2,19,2,96,2,2"
+ paddingLeft="7px" paddingRight="7px" width="100px" height="23px" childLayout="center"
+ visibleToMouse="true"/>
+ <effect>
+ <onHover name="border" color="#822f" post="true"/>
+ <onFocus name="imageOverlay" filename="button/button.png"
+ imageMode="sprite-resize:100,23,1,2,96,2,2,2,96,2,19,2,96,2,2" post="true"/>
+ <onEnabled name="renderQuad" startColor="#2228" endColor="#2220" post="true" length="150"/>
+ <onDisabled name="renderQuad" startColor="#2220" endColor="#2228" post="true" length="150"/>
+ </effect>
+ </style>
- <!-- +++++++++++++++++++++++++++++++++++++ -->
- <!-- style for the button text -->
- <!-- +++++++++++++++++++++++++++++++++++++ -->
- <style id="nifty-button#text" base="button-font">
- <attributes align="center" valign="center" textHAlign="center" textVAlign="center" visibleToMouse="false"/>
- <effect>
- <onEnabled name="textColorAnimated" startColor="#8886" endColor="#eeef" post="false" length="150" />
- <onDisabled name="textColorAnimated" startColor="#eeef" endColor="#8886" post="false" length="150" />
- </effect>
- </style>
+ <!-- +++++++++++++++++++++++++++++++++++++ -->
+ <!-- style for the button text -->
+ <!-- +++++++++++++++++++++++++++++++++++++ -->
+ <style id="nifty-button#text" base="button-font">
+ <attributes align="center" valign="center" textHAlign="center" textVAlign="center" visibleToMouse="false"/>
+ <effect>
+ <onEnabled name="textColorAnimated" startColor="#8886" endColor="#eeef" post="false" length="150"/>
+ <onDisabled name="textColorAnimated" startColor="#eeef" endColor="#8886" post="false" length="150"/>
+ </effect>
+ </style>
</nifty-styles>
@@ -1,36 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
-<nifty-styles xmlns="http://nifty-gui.lessvoid.com/nifty-gui">
-
- <style id="nifty-chat-control#mainPanel">
- <attributes childLayout="vertical" width="100%" />
- </style>
-
- <style id="nifty-chat-control#chatPanel">
- <attributes childLayout="horizontal" width="100%" align="center" />
- </style>
-
- <style id="nifty-chat-control#chatArea">
- <attributes childLayout="horizontal" align="left" width="75%" />
- </style>
-
- <style id="nifty-chat-control#playerArea">
- <attributes childLayout="vertical" width="25%" />
- </style>
-
- <style id="nifty-chat-control#spacer">
- <attributes height="9px" width="100%" />
- </style>
-
- <style id="nifty-chat-control#chatTextArea">
- <attributes childLayout="horizontal" align="left" width="75%" />
- </style>
-
- <style id="current-player">
- <attributes backgroundImage="panel/nifty-panel-red-no-shadow.png" imageMode="resize:8,210,8,8,8,210,8,209,8,210,8,8" />
- </style>
-
- <style id="default">
- <attributes backgroundImage="panel/nifty-panel-no-shadow.png" imageMode="resize:8,210,8,8,8,210,8,209,8,210,8,8" />
- </style>
-
+<nifty-styles xmlns="http://nifty-gui.lessvoid.com/nifty-gui">
+
+ <style id="nifty-chat-control#mainPanel">
+ <attributes childLayout="vertical" width="100%"/>
+ </style>
+
+ <style id="nifty-chat-control#chatPanel">
+ <attributes childLayout="horizontal" width="100%" align="center"/>
+ </style>
+
+ <style id="nifty-chat-control#chatArea">
+ <attributes childLayout="horizontal" align="left" width="75%"/>
+ </style>
+
+ <style id="nifty-chat-control#playerArea">
+ <attributes childLayout="vertical" width="25%"/>
+ </style>
+
+ <style id="nifty-chat-control#spacer">
+ <attributes height="9px" width="100%"/>
+ </style>
+
+ <style id="nifty-chat-control#chatTextArea">
+ <attributes childLayout="horizontal" align="left" width="75%"/>
+ </style>
+
+ <style id="current-player">
+ <attributes backgroundImage="panel/nifty-panel-red-no-shadow.png"
+ imageMode="resize:8,210,8,8,8,210,8,209,8,210,8,8"/>
+ </style>
+
+ <style id="default">
+ <attributes backgroundImage="panel/nifty-panel-no-shadow.png"
+ imageMode="resize:8,210,8,8,8,210,8,209,8,210,8,8"/>
+ </style>
+
</nifty-styles>
@@ -1,27 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
-<nifty-styles xmlns="http://nifty-gui.lessvoid.com/nifty-gui">
+<nifty-styles xmlns="http://nifty-gui.lessvoid.com/nifty-gui">
- <style id="nifty-checkbox-style#panel">
- <attributes width="23px" height="23px" childLayout="center" backgroundColor="#666f" />
- <effect>
- <onActive name="border" color="#222f" post="true" inset="1px" />
- <onFocus name="colorBar" color="#800f" post="true" inset="1px" />
- <onHover name="border" color="#822f" post="true" />
- <onEnabled name="renderQuad" startColor="#2228" endColor="#2220" post="true" length="150" />
- <onDisabled name="renderQuad" startColor="#2220" endColor="#2228" post="true" length="150" />
- </effect>
- </style>
-
- <style id="nifty-checkbox-style#select">
- <attributes align="center" valign="center" width="32px" height="32px" />
- <effect overlay="true">
- <onCustom customKey="show" name="imageSize" startSize="2.0" endSize="1.0" length="250" post="true" />
- <onCustom customKey="show" name="fade" start="#0" end="#f" length="250" post="true" />
- <onCustom customKey="show" name="imageOverlay" filename="checkbox/checkbox.png" width="32px" height="32px" post="true" neverStopRendering="true" />
- <onCustom customKey="hide" name="fade" start="#f" end="#0" length="250" post="true" />
- <onCustom customKey="hide" name="imageOverlay" filename="checkbox/checkbox.png" width="32px" height="32px" post="true" length="250" />
- <onEnabled name="fade" start="#4" end="#f" length="150" post="false" />
- <onDisabled name="fade" start="#f" end="#4" length="150" post="false" />
- </effect>
- </style>
+ <style id="nifty-checkbox-style#panel">
+ <attributes width="23px" height="23px" childLayout="center" backgroundColor="#666f"/>
+ <effect>
+ <onActive name="border" color="#222f" post="true" inset="1px"/>
+ <onFocus name="colorBar" color="#800f" post="true" inset="1px"/>
+ <onHover name="border" color="#822f" post="true"/>
+ <onEnabled name="renderQuad" startColor="#2228" endColor="#2220" post="true" length="150"/>
+ <onDisabled name="renderQuad" startColor="#2220" endColor="#2228" post="true" length="150"/>
+ </effect>
+ </style>
+
+ <style id="nifty-checkbox-style#select">
+ <attributes align="center" valign="center" width="32px" height="32px"/>
+ <effect overlay="true">
+ <onCustom customKey="show" name="imageSize" startSize="2.0" endSize="1.0" length="250" post="true"/>
+ <onCustom customKey="show" name="fade" start="#0" end="#f" length="250" post="true"/>
+ <onCustom customKey="show" name="imageOverlay" filename="checkbox/checkbox.png" width="32px" height="32px"
+ post="true" neverStopRendering="true"/>
+ <onCustom customKey="hide" name="fade" start="#f" end="#0" length="250" post="true"/>
+ <onCustom customKey="hide" name="imageOverlay" filename="checkbox/checkbox.png" width="32px" height="32px"
+ post="true" length="250"/>
+ <onEnabled name="fade" start="#4" end="#f" length="150" post="false"/>
+ <onDisabled name="fade" start="#f" end="#4" length="150" post="false"/>
+ </effect>
+ </style>
</nifty-styles>
@@ -1,57 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
-<nifty-styles xmlns="http://nifty-gui.lessvoid.com/nifty-gui">
+<nifty-styles xmlns="http://nifty-gui.lessvoid.com/nifty-gui">
- <registerMouseCursor id="textFieldCursor" filename="textfield/mouse-cursor-textfield.png" hotspotX="3" hotspotY="12"/>
+ <registerMouseCursor id="textFieldCursor" filename="textfield/mouse-cursor-textfield.png" hotspotX="3"
+ hotspotY="12"/>
- <!-- console panel style -->
- <style id="nifty-console-panel">
- <attributes childLayout="vertical" backgroundColor="#822A" />
- <effect>
- <onActive name="border" border="1px" color="#222f" />
- </effect>
- </style>
+ <!-- console panel style -->
+ <style id="nifty-console-panel">
+ <attributes childLayout="vertical" backgroundColor="#822A"/>
+ <effect>
+ <onActive name="border" border="1px" color="#222f"/>
+ </effect>
+ </style>
- <!-- nifty-console-listbox -->
+ <!-- nifty-console-listbox -->
- <style id="nifty-console-listbox">
- <attributes />
- </style>
- <style id="nifty-console-listbox#scrollpanel">
- <attributes focusable="true" borderBottom="1px" borderColor="#000f"/>
- </style>
- <style id="nifty-console-listbox#bottom-right">
- <attributes width="20px" height="20px" />
- </style>
- <style id="nifty-console-listbox-item">
- <attributes font="console.fnt" height="14px" width="100%" align="left" textVAlign="center" textHAlign="left" />
- <effect>
- <onCustom customKey="focus" name="colorBar" post="false" color="#4446" neverStopRendering="true" timeType="infinite" />
- </effect>
- </style>
+ <style id="nifty-console-listbox">
+ <attributes/>
+ </style>
+ <style id="nifty-console-listbox#scrollpanel">
+ <attributes focusable="true" borderBottom="1px" borderColor="#000f"/>
+ </style>
+ <style id="nifty-console-listbox#bottom-right">
+ <attributes width="20px" height="20px"/>
+ </style>
+ <style id="nifty-console-listbox-item">
+ <attributes font="console.fnt" height="14px" width="100%" align="left" textVAlign="center" textHAlign="left"/>
+ <effect>
+ <onCustom customKey="focus" name="colorBar" post="false" color="#4446" neverStopRendering="true"
+ timeType="infinite"/>
+ </effect>
+ </style>
- <!-- nifty-console-textfield -->
+ <!-- nifty-console-textfield -->
- <style id="nifty-console-textfield#panel">
- <attributes childLayout="overlay" height="20px" />
- <effect>
- <onHover name="changeMouseCursor" id="textFieldCursor" />
- <onActive name="border" border="1px,0px,0px,0px" color="#222f" />
- </effect>
- </style>
- <style id="nifty-console-textfield#field">
- <attributes childLayout="center" childClip="true" />
- </style>
- <style id="nifty-console-textfield#text">
- <attributes font="console.fnt" selectionColor="#f00f" visibleToMouse="false" align="left" textHAlign="left" textVAlign="center" valign="center"/>
- </style>
- <style id="nifty-console-textfield#cursor-panel">
- <attributes childLayout="absolute" />
- </style>
- <style id="nifty-console-textfield#cursor">
- <attributes filename="console_cursor_empty.png"/>
- <effect>
- <onCustom name="imageOverlayPulsate" period="250" timeType="infinite" pulsateType="rectangle" filename="console_cursor.png" post="true"/>
- </effect>
- </style>
+ <style id="nifty-console-textfield#panel">
+ <attributes childLayout="overlay" height="20px"/>
+ <effect>
+ <onHover name="changeMouseCursor" id="textFieldCursor"/>
+ <onActive name="border" border="1px,0px,0px,0px" color="#222f"/>
+ </effect>
+ </style>
+ <style id="nifty-console-textfield#field">
+ <attributes childLayout="center" childClip="true"/>
+ </style>
+ <style id="nifty-console-textfield#text">
+ <attributes font="console.fnt" selectionColor="#f00f" visibleToMouse="false" align="left" textHAlign="left"
+ textVAlign="center" valign="center"/>
+ </style>
+ <style id="nifty-console-textfield#cursor-panel">
+ <attributes childLayout="absolute"/>
+ </style>
+ <style id="nifty-console-textfield#cursor">
+ <attributes filename="console_cursor_empty.png"/>
+ <effect>
+ <onCustom name="imageOverlayPulsate" period="250" timeType="infinite" pulsateType="rectangle"
+ filename="console_cursor.png" post="true"/>
+ </effect>
+ </style>
</nifty-styles>
Oops, something went wrong.

0 comments on commit bd08f8c

Please sign in to comment.