Java Code Examples for org.jdesktop.swingx.tips.TipLoader

The following examples show how to use org.jdesktop.swingx.tips.TipLoader. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: otroslogviewer   Source File: TipOfTheDay.java    License: Apache License 2.0 6 votes vote down vote up
public void showTipOfTheDayIfNotDisabled(Component parent) {
  Properties p = new Properties();
  try {
    p.load(this.getClass().getClassLoader().getResourceAsStream("tipoftheday.properties"));
    TipOfTheDayModel model = new RandomTipOfTheDayModel(TipLoader.load(p));
    JXTipOfTheDay jxTipOfTheDay = new JXTipOfTheDay(model);
    jxTipOfTheDay.showDialog(parent, new ShowOnStartupChoice() {

      @Override
      public void setShowingOnStartup(boolean arg0) {
        dataConfiguration.setProperty(GUI_SHOW_TIP_OF_THE_DAY, arg0);
      }

      @Override
      public boolean isShowingOnStartup() {
        return dataConfiguration.getBoolean(GUI_SHOW_TIP_OF_THE_DAY, true);
      }
    });
  } catch (IOException e) {
    LOGGER.warn("Can't load tip of the day: " + e.getMessage());
  }
}
 
Example 2
public TipsOfTheDayDialog() throws IOException {
	Properties tips = new Properties();
	tips.load(MTGConstants.TOOLTIPS_FILE.openStream());
	TipOfTheDayModel model = TipLoader.load(tips);
	setModel(model);

}
 
Example 3
Source Project: Pixelitor   Source File: TipsOfTheDay.java    License: GNU General Public License v3.0 5 votes vote down vote up
private static TipOfTheDayModel loadModel() throws IOException {
    var properties = new Properties();
    TipOfTheDayModel model;
    try (var propertiesInputStream = TipsOfTheDay.class.getResourceAsStream("/tips.properties")) {
        properties.load(propertiesInputStream);
        model = TipLoader.load(properties);
    }
    return model;
}
 
Example 4
private TipOfTheDayModel loadModel() throws Exception {
    Properties properties = new Properties();
    InputStream propertiesIn = OrbitUtils.DARKUI ? OrbitImageAnalysis.class.getResourceAsStream("/resource/tips.properties") : OrbitImageAnalysis.class.getResourceAsStream("/resource/tipsold.properties");
    properties.load(propertiesIn);
    return TipLoader.load(properties);
}