@Override
 public void restorePreferences(Preferences prefs) {
   int r, g, b;
   // app panel
   appearancePanel.setShowPoints(prefs.getBoolean("showPoints", DEFAULT_SHOW_POINTS));
   appearancePanel.setPointsReflecting(
       prefs.getBoolean("pointsReflecting", DEFAULT_POINTS_REFLECTING));
   appearancePanel.setPointRadius(prefs.getDouble("pointRadius", DEFAULT_POINT_RADIUS));
   r = prefs.getInt("pointColorRed", DEFAULT_POINT_COLOR.getRed());
   g = prefs.getInt("pointColorGreen", DEFAULT_POINT_COLOR.getGreen());
   b = prefs.getInt("pointColorBlue", DEFAULT_POINT_COLOR.getBlue());
   appearancePanel.setPointColor(new Color(r, g, b));
   appearancePanel.setShowLines(prefs.getBoolean("showLines", DEFAULT_SHOW_LINES));
   appearancePanel.setLinesReflecting(
       prefs.getBoolean("linesReflecting", DEFAULT_LINES_REFLECTING));
   appearancePanel.setTubeRadius(prefs.getDouble("tubeRadius", DEFAULT_TUBE_RADIUS));
   r = prefs.getInt("lineColorRed", DEFAULT_LINE_COLOR.getRed());
   g = prefs.getInt("lineColorGreen", DEFAULT_LINE_COLOR.getGreen());
   b = prefs.getInt("lineColorBlue", DEFAULT_LINE_COLOR.getBlue());
   appearancePanel.setLineColor(new Color(r, g, b));
   appearancePanel.setShowFaces(prefs.getBoolean("showFaces", DEFAULT_SHOW_FACES));
   appearancePanel.setFacesReflecting(
       prefs.getBoolean("facesReflecting", DEFAULT_FACES_REFLECTING));
   appearancePanel.setFaceReflection(prefs.getDouble("faceReflection", DEFAULT_FACE_REFLECTION));
   appearancePanel.setLineReflection(prefs.getDouble("lineReflection", DEFAULT_LINE_REFLECTION));
   appearancePanel.setPointReflection(
       prefs.getDouble("pointReflection", DEFAULT_POINT_REFLECTION));
   r = prefs.getInt("faceColorRed", DEFAULT_FACE_COLOR.getRed());
   g = prefs.getInt("faceColorGreen", DEFAULT_FACE_COLOR.getGreen());
   b = prefs.getInt("faceColorBlue", DEFAULT_FACE_COLOR.getBlue());
   appearancePanel.setFaceColor(new Color(r, g, b));
   appearancePanel.setTransparencyEnabled(
       prefs.getBoolean("transparencyEnabled", DEFAULT_TRANSPARENCY_ENABLED));
   appearancePanel.setTransparency(prefs.getDouble("transparency", DEFAULT_TRANSPARENCY));
   appearancePanel.setFacesFlat(prefs.getBoolean("facesFlat", DEFAULT_FACES_FLAT));
   appearancePanel.setTubes(prefs.getBoolean("tubes", DEFAULT_TUBES));
   appearancePanel.setSpheres(prefs.getBoolean("spheres", DEFAULT_SPHERES));
 }
 @Override
 public void restoreDefaults() {
   // app panel
   appearancePanel.setShowPoints(DEFAULT_SHOW_POINTS);
   appearancePanel.setPointsReflecting(DEFAULT_POINTS_REFLECTING);
   appearancePanel.setPointRadius(DEFAULT_POINT_RADIUS);
   appearancePanel.setPointColor(DEFAULT_POINT_COLOR);
   appearancePanel.setShowLines(DEFAULT_SHOW_LINES);
   appearancePanel.setLinesReflecting(DEFAULT_LINES_REFLECTING);
   appearancePanel.setTubeRadius(DEFAULT_TUBE_RADIUS);
   appearancePanel.setLineColor(DEFAULT_LINE_COLOR);
   appearancePanel.setShowFaces(DEFAULT_SHOW_FACES);
   appearancePanel.setFacesReflecting(DEFAULT_FACES_REFLECTING);
   appearancePanel.setFaceReflection(DEFAULT_FACE_REFLECTION);
   appearancePanel.setFaceReflection(DEFAULT_LINE_REFLECTION);
   appearancePanel.setFaceReflection(DEFAULT_POINT_REFLECTION);
   appearancePanel.setFaceColor(DEFAULT_FACE_COLOR);
   appearancePanel.setTransparencyEnabled(DEFAULT_TRANSPARENCY_ENABLED);
   appearancePanel.setTransparency(DEFAULT_TRANSPARENCY);
   appearancePanel.setFacesFlat(DEFAULT_FACES_FLAT);
   appearancePanel.setTubes(DEFAULT_TUBES);
   appearancePanel.setSpheres(DEFAULT_SPHERES);
 }