/** * {@inheritDoc} * * @see kendzi.kendzi3d.models.library.dao.LibraryResourcesDao#saveResourcesPath(java.util.List) */ @Override public void saveResourcesPath(List<String> fileKeys) { Config.getPref().putList(KENDZI_3D_MODELS_LIBRARY_RESOURCES_URLS, fileKeys); }
@Override public void setDefaultResourcesPaths() { Config.getPref().put(KENDZI_3D_MODELS_LIBRARY_RESOURCES_URLS, null); }
/** * {@inheritDoc} * * @see kendzi.kendzi3d.models.library.dao.LibraryResourcesDao#loadResourcesPath() */ @Override public List<String> loadResourcesPath() { List<String> paths = new ArrayList<String>(Config.getPref().getList(KENDZI_3D_MODELS_LIBRARY_RESOURCES_URLS)); if (paths == null | paths.isEmpty()) { return defaultResources(); } return paths; }
public void initializeKendzi3dLayer(CameraLayer cameraLayer) { if (!Config.getPref().getBoolean(PREF_LAYER, true)) { return; } cameraLayer.addCameraLayer(); }
@Override public void save(LightConfiguration lightLocation) { Config.getPref().putDouble(KENDZI_3D_LIGHT_DIRECTION, lightLocation.getDirection()); Config.getPref().putDouble(KENDZI_3D_LIGHT_ANGLE, lightLocation.getAngle()); Config.getPref().put(KENDZI_3D_LIGHT_AMBIENT_COLOR, formatHexColor(lightLocation.getAmbientColor())); Config.getPref().put(KENDZI_3D_LIGHT_DIFFUSE_COLOR, formatHexColor(lightLocation.getDiffuseColor())); }
@Override public LightConfiguration load() { LightConfiguration conf = new LightConfiguration(); conf.setDirection( Config.getPref().getDouble(KENDZI_3D_LIGHT_DIRECTION, DEFAULT_DIRECTION)); conf.setAngle( Config.getPref().getDouble(KENDZI_3D_LIGHT_ANGLE, DEFAULT_ANGLE)); Color ambientColor = ParseUtil.parseHexColor( Config.getPref().get(KENDZI_3D_LIGHT_AMBIENT_COLOR, "")); if (ambientColor == null) { ambientColor = DEFAULT_AMBIENT_COLOR; } conf.setAmbientColor(ambientColor); Color diffuseColor = ParseUtil.parseHexColor( Config.getPref().get(KENDZI_3D_LIGHT_DIFFUSE_COLOR, "")); if (diffuseColor == null) { diffuseColor = DEFAULT_DIFFUSE_COLOR; } conf.setDiffuseColor(diffuseColor); return conf; }
@Override public void actionPerformed(ActionEvent e) { toggleSelectedState(e); boolean selected = isSelected(); Config.getPref().putBoolean(KENDZI_3D_AUTOSTART, selected); notifySelectedState(); } }
@Override public void actionPerformed(ActionEvent e) { toggleSelectedState(e); boolean selected = isSelected(); Config.getPref().putBoolean(KENDZI_3D_MODEL_LIBRARY_DEBUG_VIEW, selected); notifySelectedState(); setState(selected); }
@Override public void actionPerformed(ActionEvent e) { toggleSelectedState(e); boolean selected = isSelected(); Config.getPref().putBoolean(KENDZI_3D_GROUND_TEXTURED, selected); notifySelectedState(); setTexturedGround(selected); }
@Override public void actionPerformed(ActionEvent e) { toggleSelectedState(e); boolean selected = isSelected(); Config.getPref().putBoolean(KENDZI_3D_MODELS_TEXTURED, selected); notifySelectedState(); setState(selected); }
/** * Will be invoked by JOSM to bootstrap the plugin. * * @param pInfo * information about the plugin and its local installation */ public Kendzi3DPlugin(PluginInformation pInfo) { super(pInfo); ExceptionHandler.registerExceptionHandler(); try { JoglPlugin.addJoglToClassPath(); loadLibrary(); } catch (Exception e) { e.printStackTrace(); } Injector injector = Guice.createInjector(new Kendzi3dModule(getPluginDirs().getUserDataDirectory(false).getPath())); refreshMenu(injector); if (!Boolean.FALSE.equals(Config.getPref().getBoolean(AutostartToggleAction.KENDZI_3D_AUTOSTART, false))) { openKendzi3dWindow(injector); } }
@Override public void actionPerformed(ActionEvent e) { toggleSelectedState(e); boolean selected = isSelected(); Config.getPref().putBoolean(KENDZI_3D_DEBUG_VIEW, selected); notifySelectedState(); setState(selected); }
/** * Constructor of texture toggle action. * * @param pModelRender ModelRender */ @Inject public TextureToggleAction(ModelRender pModelRender) { super(tr("Textured Models"), "1306318261_debugger__24", tr("Enable/disable display texture on models"), null, false); this.modelRender = pModelRender; MainApplication.getToolbar().register(this); boolean selected = Config.getPref().getBoolean(KENDZI_3D_MODELS_TEXTURED, true); setSelected(selected); notifySelectedState(); setState(selected); }
/** * Constructor of ground toggle action. * * @param selectableGround * ground drawer */ @Inject public GroundToggleAction(SelectableGround selectableGround) { super(tr("Textured Ground"), "1306318261_debugger__24", tr("Enable/disable display texture on ground"), null, false); MainApplication.getToolbar().register(this); boolean selected = Config.getPref().getBoolean(KENDZI_3D_GROUND_TEXTURED, false); setSelected(selected); notifySelectedState(); this.selectableGround = selectableGround; setTexturedGround(selected); }
/** * Constructor of debug toggle action. * * @param pModelRender * model render */ @Inject public DebugToggleAction(ModelRender pModelRender) { super(tr("Debug View"), "1306318261_debugger__24", tr("Enable/disable display debug information"), null, false); modelRender = pModelRender; MainApplication.getToolbar().register(this); boolean selected = Config.getPref().getBoolean(KENDZI_3D_DEBUG_VIEW, false); setSelected(selected); notifySelectedState(); setState(selected); }
/** * Constructor of debug toggle action. */ public AutostartToggleAction() { super(tr("Plugin autostart"), "1323594394_apply-icon24.png", tr("Enable/disable autostart"), null, false); MainApplication.getToolbar().register(this); boolean selected = Config.getPref().getBoolean(KENDZI_3D_AUTOSTART, false); setSelected(selected); notifySelectedState(); }
/** * Constructor of debug toggle action. * * @param pModelRender * model render */ @Inject public DebugPointModelToggleAction() { super(tr("Debug models library"), "1306318261_debugger__24", tr("Enable/disable display debug information for model library"), null, false); // putValue("help", ht("/Action/FullscreenView")); // putValue("toolbar", "fullscreen"); MainApplication.getToolbar().register(this); boolean selected = Config.getPref().getBoolean(KENDZI_3D_MODEL_LIBRARY_DEBUG_VIEW, false); setSelected(selected); notifySelectedState(); setState(selected); }