r564 - in trunk: faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor faxtomail-ui-swing/src/main/resources/i18n
Author: kmorin Date: 2014-08-14 17:25:29 +0200 (Thu, 14 Aug 2014) New Revision: 564 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/564 Log: fixes #5380 La taille de la police est mauvaise quand on g?\195?\169n?\195?\168re apr?\195?\168s un zoom fix lazy Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorCrossUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorHighlighterUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorLineUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorNoteUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorNoteUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-08-14 15:25:29 UTC (rev 564) @@ -367,7 +367,7 @@ String hqlForFetchStep1 = "select E." + TopiaEntity.PROPERTY_TOPIA_ID + " FROM " + Email.class.getName() + " E " + query.toString(); String hqlForFetchStep2 = "select distinct E FROM " + Email.class.getName() + " E " + addAllFecthes( Email.PROPERTY_PRIORITY, - Email.PROPERTY_DEMAND_TYPE, + Email.PROPERTY_DEMAND_TYPE + "." + DemandType.PROPERTY_FIELDS, Email.PROPERTY_CLIENT, Email.PROPERTY_RANGE_ROW + "." + RangeRow.PROPERTY_RANGE, Email.PROPERTY_ETAT_ATTENTE, Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/GenerateAnnotatedAttachmentAction.java 2014-08-14 15:25:29 UTC (rev 564) @@ -125,7 +125,8 @@ cb.saveState(); JTextArea textArea = note.getNoteText(); float fontSize = textArea.getFont().getSize2D() / zoom; - BaseFont font = BaseFont.createFont(BaseFont.HELVETICA_OBLIQUE, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED); + BaseFont titleFont = BaseFont.createFont(BaseFont.HELVETICA_OBLIQUE, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED); + BaseFont font = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED); String text = note.getText(); String[] rows = text.split("\n"); @@ -150,7 +151,7 @@ yyy += height - insets.top / zoom; } - showTextAligned(cb, note.getTitle(), xxx, yyy, rotation, font, fontSize); + showTextAligned(cb, note.getTitle(), xxx, yyy, rotation, titleFont, fontSize); for (String s : rows) { if (s.isEmpty()) { Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorCrossUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorCrossUI.css 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorCrossUI.css 2014-08-14 15:25:29 UTC (rev 564) @@ -30,9 +30,10 @@ } #removeButton { - text: "X"; - //borderPainted: { false }; - //border: { null }; - //opaque : { false }; - //background: { null }; + text: " X "; + border : { BorderFactory.createLineBorder(Color.BLACK, 1, false) }; + opaque: false; + background: { null }; + contentAreaFilled: false; + focusPainted: false; } \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorHighlighterUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorHighlighterUI.css 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorHighlighterUI.css 2014-08-14 15:25:29 UTC (rev 564) @@ -29,9 +29,10 @@ } #removeButton { - text: "X"; - //borderPainted: { false }; - //border: { null }; - //opaque : { false }; - //background: { null }; + text: " X "; + border : { BorderFactory.createLineBorder(Color.BLACK, 1, false) }; + opaque: false; + background: { null }; + contentAreaFilled: false; + focusPainted: false; } \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorLineUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorLineUI.css 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorLineUI.css 2014-08-14 15:25:29 UTC (rev 564) @@ -29,9 +29,10 @@ } #removeButton { - text: "X"; - //borderPainted: { false }; - //border: { null }; - //opaque : { false }; - //background: { null }; + text: " X "; + border : { BorderFactory.createLineBorder(Color.BLACK, 1, false) }; + opaque: false; + background: { null }; + contentAreaFilled: false; + focusPainted: false; } \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorNoteUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorNoteUI.css 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorNoteUI.css 2014-08-14 15:25:29 UTC (rev 564) @@ -32,16 +32,17 @@ #noteTitle { font: { Font.decode(BaseFont.HELVETICA).deriveFont(Font.ITALIC) }; - font-size: { (float)(DEFAULT_FONT_SIZE * getZoom() / getOriginalZoom()) }; + font-size: { (float)(DEFAULT_FONT_SIZE * getZoom()) }; text: { getTitle() }; } #removeButton { - text: "X"; - /*borderPainted: { false }; - border: { null }; - opaque : { false }; - background: { null }; */ + text: " X "; + border : { BorderFactory.createLineBorder(Color.BLACK, 1, false) }; + opaque: false; + background: { null }; + contentAreaFilled: false; + focusPainted: false; } #noteText { @@ -49,7 +50,7 @@ opaque : { false }; background: { null }; font: { Font.decode(BaseFont.HELVETICA) }; - font-size: { (float)(DEFAULT_FONT_SIZE * getZoom() / getOriginalZoom()) }; + font-size: { (float)(DEFAULT_FONT_SIZE * getZoom()) }; lineWrap: { false }; wrapStyleWord: { false }; } \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorNoteUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorNoteUI.jaxx 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorNoteUI.jaxx 2014-08-14 15:25:29 UTC (rev 564) @@ -21,7 +21,7 @@ <http://www.gnu.org/licenses/gpl-3.0.html>. #L% --> -<JPanel id='notePanel' layout='{new BorderLayout()}'> +<JPanel id='notePanel' layout='{new BorderLayout()}' onComponentResized="pack()"> <import> java.awt.Color @@ -41,13 +41,18 @@ protected void textTyped() { setText(getNoteText().getText()); + pack(); + } + protected void pack() { JPanel container = getParentContainer(JPanel.class); Point location = getLocation(); - Insets insets = container.getInsets(); + Insets containerInsets = container.getInsets(); Dimension size = getPreferredSize(); - setBounds(location.x + insets.left, location.y + insets.top, - size.width, size.height); + setBounds(location.x + containerInsets.left, + location.y + containerInsets.top, + size.width + 10, // no real logical reason for 10, but otherwise, the text is sometimes cut in the end + size.height); } protected void removeNote() { @@ -60,7 +65,6 @@ <String id="title" javaBean="null"/> <String id="text" javaBean=""/> - <Float id="originalZoom" javaBean="1.0f"/> <Float id="zoom" javaBean="1.0f"/> <JPanel id="noteHeader" @@ -75,6 +79,6 @@ <JTextArea id="noteText" constraints="BorderLayout.CENTER" - onKeyTyped="textTyped()"/> + onKeyReleased="textTyped()"/> </JPanel> \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java 2014-08-14 15:25:29 UTC (rev 564) @@ -291,7 +291,6 @@ public void addNote(int x, int y) { PDFEditorNoteUI note = new PDFEditorNoteUI(); - note.setOriginalZoom(getModel().getZoom()); note.setZoom(getModel().getZoom()); String title = decorate(new Date()) + " - " + getContext().getCurrentUser().getTrigraph(); note.setTitle(title); @@ -587,13 +586,13 @@ public void zoomOut() { PDFEditorUIModel model = getModel(); float zoom = model.getZoom(); - model.setZoom(zoom - 0.25f); + model.setZoom(zoom - 0.5f); } public void zoomIn() { PDFEditorUIModel model = getModel(); float zoom = model.getZoom(); - model.setZoom(zoom + 0.25f); + model.setZoom(zoom + 0.5f); } public void rotateClockwise() { Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java 2014-08-14 15:25:29 UTC (rev 564) @@ -236,7 +236,7 @@ } public void setZoom(float zoom) { - if (zoom > 0) { + if (zoom >= 1f && zoom <= 15f) { Object oldValue = getZoom(); this.zoom = zoom; firePropertyChanged(PROPERTY_ZOOM, oldValue, zoom); Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties =================================================================== --- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-08-14 13:16:09 UTC (rev 563) +++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-08-14 15:25:29 UTC (rev 564) @@ -1,3 +1,4 @@ +\ X\ = \ |\ = /= \:=
participants (1)
-
kmorin@users.forge.codelutin.com