}
southPanel.revalidate();
}
void setDefaultFont() {
final StyleSheet styleSheet = noteViewerComponent.getDocument().getStyleSheet();
styleSheet.removeStyle("body");
styleSheet.removeStyle("p");
// set default font for notes:
final NodeStyleController style = Controller.getCurrentModeController().getExtension(
NodeStyleController.class);
MapModel map = Controller.getCurrentModeController().getController().getMap();
if(map != null){
final Font defaultFont;
defaultFont = style.getDefaultFont(map, MapStyleModel.NOTE_STYLE);
String rule = "body {";
rule += "font-family: " + defaultFont.getFamily() + ";";
rule += "font-size: " + defaultFont.getSize() + "pt;";
if (defaultFont.isItalic()) {
rule += "font-style: italic; ";
}
if (defaultFont.isBold()) {
rule += "font-weight: bold; ";
}
rule += "}\n";
styleSheet.addRule(rule);
}
if (ResourceController.getResourceController().getBooleanProperty(
MNoteController.RESOURCES_USE_MARGIN_TOP_ZERO_FOR_NOTES)) {
/* this is used for paragraph spacing. I put it here, too, as
* the tooltip display uses the same spacing. But it is to be discussed.
* fc, 23.3.2009.
*/
String rule = "p {";
rule += "margin-top:0;";
rule += "}\n";
styleSheet.addRule(rule);
}
}