- make welcome screen use version-specific welcome page
- some cleanups in welcome screen

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9966 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 7b85ebead3
commit 1fbdbc59bb
  1. 3
      sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/Bundle.properties
  2. 1
      sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.form
  3. 36
      sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/WelcomeScreenTopComponent.java
  4. 10
      sdk/jme3-welcome-screen/src/com/jme3/gde/welcome/rss/RssFeedParser.java

@ -4,3 +4,6 @@ OpenIDE-Module-Long-Description=\
OpenIDE-Module-Name=Welcome Screen
OpenIDE-Module-Short-Description=The jMonkeyEngine GDE Welcome Screen
WelcomeScreenTopComponent.jTextPane1.border.title=Latest jMonkeyEngine News
WelcomeScreenTopComponent.http.link=http://jmonkeyengine.org/wiki/doku.php/sdk:welcome:3_0rc3?do=export_xhtmlbody
WelcomeScreenTopComponent.rss.link=http://jmonkeyengine.org/feed/rdf/
WelcomeScreenTopComponent.local.link=nbres:/com/jme3/gde/core/docs/core-about.html

@ -87,6 +87,7 @@
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Latest jMonkeyEngine News">
<ResourceString PropertyName="titleX" bundle="com/jme3/gde/welcome/Bundle.properties" key="WelcomeScreenTopComponent.jTextPane1.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<Font PropertyName="font" name="Lucida Grande" size="13" style="1"/>
</TitledBorder>
</Border>
</Property>

@ -9,7 +9,6 @@ import java.io.IOException;
import java.net.URL;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.html.StyleSheet;
import org.netbeans.api.settings.ConvertAsProperties;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@ -41,7 +40,7 @@ preferredID = "WelcomeScreenTopComponent")
})
public final class WelcomeScreenTopComponent extends TopComponent implements HyperlinkListener {
private final RssFeedParser parser = new RssFeedParser("http://jmonkeyengine.org/feed/rdf/");//"http://www.chip.de/rss/rss_tests.xml");
private final RssFeedParser parser = new RssFeedParser(org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.rss.link"));//"http://www.chip.de/rss/rss_tests.xml");
public WelcomeScreenTopComponent() {
initComponents();
@ -49,7 +48,7 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp
jScrollPane2.getViewport().setOpaque(false);
jScrollPane3.setOpaque(false);
jScrollPane3.getViewport().setOpaque(false);
setName(Bundle.CTL_WelcomeScreenTopComponent());
setToolTipText(Bundle.HINT_WelcomeScreenTopComponent());
@ -58,23 +57,6 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp
jTextPane1.addHyperlinkListener(this);
jEditorPane1.addHyperlinkListener(this);
// StyleSheet sheet = new StyleSheet();
// sheet.addRule("background-color: transparent;");
// parser.getEditorKit().setStyleSheet(sheet);
try {
jEditorPane1.setPage(new URL("http://jmonkeyengine.org/wiki/doku.php/sdk:welcome?do=export_xhtmlbody"));
// jEditorPane1.setPage(new URL("nbres:/com/jme3/gde/core/docs/core-about.html"));
} catch (IOException ex) {
try {
jEditorPane1.setPage(new URL("nbres:/com/jme3/gde/core/docs/core-about.html"));
} catch (IOException ex1) {
Exceptions.printStackTrace(ex1);
}
}
// jEditorPane2.setBackground(new Color(0, 0, 0, 128));
// jTextPane1.setBackground(new Color(0, 0, 0, 128));
parser.updateFeed();
}
/**
@ -99,7 +81,7 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp
jScrollPane3.setOpaque(false);
jTextPane1.setEditable(false);
jTextPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.jTextPane1.border.title"))); // NOI18N
jTextPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.jTextPane1.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Lucida Grande", 1, 13))); // NOI18N
jTextPane1.setFont(new java.awt.Font("Lucida Grande", 2, 12)); // NOI18N
jTextPane1.setForeground(new java.awt.Color(0, 0, 204));
jTextPane1.setCaretColor(new java.awt.Color(255, 255, 255));
@ -146,7 +128,6 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JEditorPane jEditorPane1;
private javax.swing.JPanel jPanel1;
@ -157,7 +138,16 @@ public final class WelcomeScreenTopComponent extends TopComponent implements Hyp
@Override
public void componentOpened() {
// TODO add custom code on component opening
try {
jEditorPane1.setPage(new URL(org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.http.link")));
} catch (IOException ex) {
try {
jEditorPane1.setPage(new URL(org.openide.util.NbBundle.getMessage(WelcomeScreenTopComponent.class, "WelcomeScreenTopComponent.local.link")));
} catch (IOException ex1) {
Exceptions.printStackTrace(ex1);
}
}
parser.updateFeed();
}
@Override

@ -62,24 +62,24 @@ public class RssFeedParser {
public void run() {
List<FeedMessage> msgs = feed.getMessages();
try {
doc.remove(0, doc.getLength());
for (FeedMessage feedMessage : msgs) {
//AttributeSet set = new SimpleAttributeSet();
ekit.insertHTML(doc, doc.getLength(),
"<h3><a href='"
+ feedMessage.getLink()
+ "'>"
+ feedMessage.getTitle()
+ "</a>",
+ "</a></h3>",
0,
0,
HTML.Tag.H3);
null);
// ekit.insertHTML(doc, doc.getLength(),
// "<p>"
// + feedMessage.getDescription()
// + "",
// + "</p>",
// 0,
// 0,
// HTML.Tag.P);
// null);
ekit.insertHTML(doc, doc.getLength(),
"<br/>",
0,

Loading…
Cancel
Save