public void clear() {
    imagePanel.clearAll();
    if (media != null) {
      try {
        media.close();
      } catch (IOException ex) {
        // ignore
      }
    }

    binaryPanel.setBinaryData(null);
    genericTagPanel.clear();
    fontPanel.clear();
  }
 private void setTagText(Tag tag) {
   clear();
   generateEditControls(tag, true);
   StringBuilder val = new StringBuilder();
   for (String key : keys) {
     GenericTagEditor ed = editors.get(key);
     if (((Component) ed).isVisible()) {
       val.append(key).append(" : ").append(ed.getReadOnlyValue()).append("<br>");
     }
   }
   // HTML for colors:
   val.insert(0, "<html>").append("</html>");
   genericTagPropertiesEditorPane.setContentType("text/html");
   genericTagPropertiesEditorPane.setText(val.toString());
   genericTagPropertiesEditorPane.setCaretPosition(0);
   hdr.setText(tag.toString());
 }
 private void generateEditControls(Tag tag, boolean readonly) {
   clear();
   generateEditControlsRecursive(tag, "", new ArrayList<>(), new ArrayList<>(), readonly);
   change(null);
 }