diff -Nru screenstudio-3.4.0/debian/bzr-builder.manifest screenstudio-3.4.1/debian/bzr-builder.manifest --- screenstudio-3.4.0/debian/bzr-builder.manifest 2017-05-14 05:07:09.000000000 +0000 +++ screenstudio-3.4.1/debian/bzr-builder.manifest 2017-06-08 19:26:50.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~69 -lp:screenstudio revid:git-v1:78648b7fb885362bd2ed6d12741c0eae2a058b6e +# bzr-builder format 0.3 deb-version {debupstream}-0~71 +lp:screenstudio revid:git-v1:37d68facce1a1227e66f796b625cd65728a5a4d9 diff -Nru screenstudio-3.4.0/debian/changelog screenstudio-3.4.1/debian/changelog --- screenstudio-3.4.0/debian/changelog 2017-05-14 05:07:09.000000000 +0000 +++ screenstudio-3.4.1/debian/changelog 2017-06-08 19:26:50.000000000 +0000 @@ -1,8 +1,18 @@ -screenstudio (3.4.0-0~69~ubuntu16.04.1) xenial; urgency=low +screenstudio (3.4.1-0~71~ubuntu16.04.1) xenial; urgency=low * Auto build. - -- Karl Ellis Sun, 14 May 2017 05:07:09 +0000 + -- Karl Ellis Thu, 08 Jun 2017 19:26:50 +0000 + +screenstudio (3.4.1) trusty; urgency=medium + + * Fixes: See https://github.com/patrickballeux/screenstudio + * Adds: See https://github.com/patrickballeux/screenstudio + * Changes: See https://github.com/patrickballeux/screenstudio + * Removes: See https://github.com/patrickballeux/screenstudio + * New upstream version + + -- Karl Ellis Thu, 08 Jun 2017 19:40:23 +0200 screenstudio (3.4.0) trusty; urgency=medium diff -Nru screenstudio-3.4.0/src/screenstudio/gui/LabelText.java screenstudio-3.4.1/src/screenstudio/gui/LabelText.java --- screenstudio-3.4.0/src/screenstudio/gui/LabelText.java 2017-05-14 05:07:04.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/gui/LabelText.java 2017-06-08 19:26:47.000000000 +0000 @@ -22,9 +22,11 @@ */ public class LabelText { private String mText = ""; - private int mforegroundColor = 0xFF000000; - private int mbackgroundColor = 0x88FFFFFF; + private int mforegroundColor = 0xFFFFFFFF; + private int mbackgroundColor = 0x880000FF; + private int mbackgroundAreaColor = 0x00000000; private String mFontName = "Dialog"; + private int mFontSize = 20; public LabelText(String text){ mText = text; } @@ -52,6 +54,19 @@ public String getFontName() { return mFontName; } + public int getBackgroundAreaColor(){ + return mbackgroundAreaColor; + } + public void setBackgroundAreaColor(int c){ + mbackgroundAreaColor = c; + } + public int getFontSize(){ + return mFontSize; + } + public void setFontSize(int s){ + mFontSize = s; + } + @Override public String toString(){ return mText.replaceAll("\\<[^>]*>", ""); } diff -Nru screenstudio-3.4.0/src/screenstudio/gui/ScreenStudio.form screenstudio-3.4.1/src/screenstudio/gui/ScreenStudio.form --- screenstudio-3.4.0/src/screenstudio/gui/ScreenStudio.form 2017-05-14 05:07:04.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/gui/ScreenStudio.form 2017-06-08 19:26:47.000000000 +0000 @@ -1714,7 +1714,7 @@ - + diff -Nru screenstudio-3.4.0/src/screenstudio/gui/ScreenStudio.java screenstudio-3.4.1/src/screenstudio/gui/ScreenStudio.java --- screenstudio-3.4.0/src/screenstudio/gui/ScreenStudio.java 2017-05-14 05:07:04.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/gui/ScreenStudio.java 2017-06-08 19:26:47.000000000 +0000 @@ -64,7 +64,7 @@ import screenstudio.Version; import screenstudio.encoder.FFMpeg; import screenstudio.gui.images.frames.Frames; -import screenstudio.panel.editor.Editor; +import screenstudio.panel.editor.TextEditor; import screenstudio.remote.HTTPServer; import screenstudio.sources.Compositor; import screenstudio.sources.Microphone; @@ -534,6 +534,8 @@ break; case LabelText: LabelText t = new LabelText(s.getID()); + t.setBackgroundAreaColor(s.getBackgroundAreaColor()); + t.setFontSize(s.getFontSize()); t.setForegroundColor(s.getForegroundColor()); t.setBackgroundColor(s.getBackgroundColor()); t.setFontName(s.getFontName()); @@ -1828,13 +1830,14 @@ screenstudio.targets.Source source = mSources.get(rowIndex); if (source.Type == SourceType.LabelText) { LabelText t = ((LabelText) tableSources.getValueAt(rowIndex, 2)); - Editor ed = new Editor(t, this); - ed.setModal(true); + TextEditor ed = new TextEditor(source.getWidth(),source.getHeight(),t, this,true); ed.setVisible(true); - tableSources.setValueAt(ed.getLabelText(), rowIndex, 2); + //tableSources.setValueAt(t, rowIndex, 2); source.setFontName(t.getFontName()); source.setForegroundColor(t.getForegroundColor()); source.setBackgroundColor(t.getBackgroundColor()); + source.setBackgroundAreaColor(t.getBackgroundAreaColor()); + source.setFontSize(t.getFontSize()); tableSources.repaint(); } else if (source.Type == SourceType.Desktop) { Screen s = (Screen) tableSources.getValueAt(rowIndex, 2); @@ -2233,7 +2236,7 @@ source.setCurrentViewIndex(cboSourceViews.getSelectedIndex()); source.Views.get(source.CurrentViewIndex).remoteDisplay = true; source.setType(SourceType.LabelText); - source.setSourceObject(new LabelText("New Label...")); + source.setSourceObject(new LabelText("New Label...")); source.Views.get(source.CurrentViewIndex).X = 0; source.Views.get(source.CurrentViewIndex).Y = 0; source.Views.get(source.CurrentViewIndex).Width = 600; diff -Nru screenstudio-3.4.0/src/screenstudio/gui/SourceLayoutPreview.java screenstudio-3.4.1/src/screenstudio/gui/SourceLayoutPreview.java --- screenstudio-3.4.0/src/screenstudio/gui/SourceLayoutPreview.java 2017-05-14 05:07:04.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/gui/SourceLayoutPreview.java 2017-06-08 19:26:47.000000000 +0000 @@ -157,17 +157,15 @@ } break; case LabelText: - img = new BufferedImage(sw, sh, BufferedImage.TYPE_INT_ARGB); LabelText text = (LabelText) source.SourceObject; - JLabel label = new JLabel(text.getText()); - label.setFont(new Font(text.getFontName(), Font.PLAIN, sh)); - label.setSize(sw, sh); - label.setLocation(0, 0); - label.setOpaque(true); - label.setForeground(new Color(text.getForegroundColor())); - label.setBackground(new Color(text.getBackgroundColor())); - label.paint(img.createGraphics()); - g.drawImage(img, sx, sy, null); + g.setColor(new Color(text.getBackgroundAreaColor(),true)); + g.fillRect(sx,sy, sw,sh); + g.setFont(new Font(text.getFontName(),Font.PLAIN,(int)(text.getFontSize()*sh/source.getHeight()))); + int fh = (int)g.getFontMetrics().getMaxCharBounds(g).getBounds().getHeight(); + g.setColor(new Color(text.getBackgroundColor(),true)); + g.drawString("Label Text", sx, sy+fh); + g.setColor(new Color(text.getForegroundColor(),true)); + g.drawString("Label Text", sx-1, sy+fh-1); break; case Frame: Frames.eList frameName = (Frames.eList) source.SourceObject; diff -Nru screenstudio-3.4.0/src/screenstudio/panel/editor/TextEditor.form screenstudio-3.4.1/src/screenstudio/panel/editor/TextEditor.form --- screenstudio-3.4.0/src/screenstudio/panel/editor/TextEditor.form 1970-01-01 00:00:00.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/panel/editor/TextEditor.form 2017-06-08 19:26:47.000000000 +0000 @@ -0,0 +1,391 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru screenstudio-3.4.0/src/screenstudio/panel/editor/TextEditor.java screenstudio-3.4.1/src/screenstudio/panel/editor/TextEditor.java --- screenstudio-3.4.0/src/screenstudio/panel/editor/TextEditor.java 1970-01-01 00:00:00.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/panel/editor/TextEditor.java 2017-06-08 19:26:47.000000000 +0000 @@ -0,0 +1,525 @@ +/* + * Copyright (C) 2017 patrick + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package screenstudio.panel.editor; + +import java.awt.Color; +import screenstudio.gui.LabelText; +import java.awt.Font; +import java.awt.GraphicsEnvironment; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JMenuItem; +import javax.swing.JSeparator; +import screenstudio.sources.SourceText; +import screenstudio.targets.Source.View; + +/** + * + * @author patrick + */ +public class TextEditor extends javax.swing.JDialog { + + private final TextViewer mTextViewer; + private final SourceText mSource; + private final LabelText mText; + + /** + * Creates new form TextEditor + * + * @param width + * @param height + * @param text + * @param parent + * @param modal + */ + public TextEditor(int width, int height, LabelText text, java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + this.setIconImage(parent.getIconImage()); + mText = text; + Rectangle r = new Rectangle(width, height); + ArrayList views = new ArrayList<>(); + View v = new View(); + v.Height = height; + v.Width = width; + views.add(v); + slideFontSize.setValue(text.getFontSize()); + + setControls(); + txtText.setText(text.getText()); + cboFonts.setSelectedItem(text.getFontName()); + + slideFGRed.setValue(new Color(text.getForegroundColor()).getRed()); + slideFGGreen.setValue(new Color(text.getForegroundColor()).getGreen()); + slideFGBlue.setValue(new Color(text.getForegroundColor()).getBlue()); + slideFGAlpha.setValue(new Color(text.getForegroundColor(), true).getAlpha()); + + slideBGRed.setValue(new Color(text.getBackgroundColor()).getRed()); + slideBGGreen.setValue(new Color(text.getBackgroundColor()).getGreen()); + slideBGBlue.setValue(new Color(text.getBackgroundColor()).getBlue()); + slideBGAlpha.setValue(new Color(text.getBackgroundColor(), true).getAlpha()); + + slideBGRedArea.setValue(new Color(text.getBackgroundAreaColor()).getRed()); + slideBGGreenArea.setValue(new Color(text.getBackgroundAreaColor()).getGreen()); + slideBGBlueArea.setValue(new Color(text.getBackgroundAreaColor()).getBlue()); + slideBGAlphaArea.setValue(new Color(text.getBackgroundAreaColor(), true).getAlpha()); + + mSource = new SourceText(views, text); + mTextViewer = new TextViewer(mSource); + mTextViewer.setOpaque(true); + panViewer.add(mTextViewer, java.awt.BorderLayout.CENTER); + panViewer.setPreferredSize(r.getSize()); + panViewer.setSize(r.getSize()); + mTextViewer.setSize(r.getSize()); + mTextViewer.setPreferredSize(r.getSize()); + + pack(); + + } + + private void setControls() { + DefaultComboBoxModel model = new DefaultComboBoxModel<>(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()); + cboFonts.setModel(model); + String[] tags = {"@CURRENTDATE", "@CURRENTTIME", "@STARTTIME", "@RECORDINGTIME", "@UPDATE 60 SEC@", "@UPDATE 5 MIN@", "@ONCHANGEONLY", "@ONELINER", "@SCROLLVERTICAL", "@SCROLLHORIZONTAL", "@TYPEWRITER", "", "file:///path/to/file.txt"}; + for (String t : tags) { + if (t.length() > 0) { + JMenuItem m = new JMenuItem(t); + m.setActionCommand(t); + m.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + txtText.insert(e.getActionCommand(), txtText.getCaretPosition()); + mTextViewer.setText(txtText.getText()); + mText.setText(txtText.getText()); + } + }); + mnuTags.add(m); + } else { + mnuTags.add(new JSeparator()); + } + + } + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + splitter = new javax.swing.JSplitPane(); + panEditor = new javax.swing.JPanel(); + textScroller = new javax.swing.JScrollPane(); + txtText = new javax.swing.JTextArea(); + cboFonts = new javax.swing.JComboBox<>(); + slideFontSize = new javax.swing.JSlider(); + tabsColor = new javax.swing.JTabbedPane(); + panFGGroup = new javax.swing.JPanel(); + slideFGRed = new javax.swing.JSlider(); + slideFGGreen = new javax.swing.JSlider(); + slideFGBlue = new javax.swing.JSlider(); + slideFGAlpha = new javax.swing.JSlider(); + panBGGroup = new javax.swing.JPanel(); + slideBGRed = new javax.swing.JSlider(); + slideBGGreen = new javax.swing.JSlider(); + slideBGBlue = new javax.swing.JSlider(); + slideBGAlpha = new javax.swing.JSlider(); + panBGGroupArea = new javax.swing.JPanel(); + slideBGRedArea = new javax.swing.JSlider(); + slideBGGreenArea = new javax.swing.JSlider(); + slideBGBlueArea = new javax.swing.JSlider(); + slideBGAlphaArea = new javax.swing.JSlider(); + scrollViewer = new javax.swing.JScrollPane(); + panViewer = new javax.swing.JPanel(); + jMenuBar1 = new javax.swing.JMenuBar(); + mnuTags = new javax.swing.JMenu(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("ScreenStudio Editor"); + setAlwaysOnTop(true); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent evt) { + formWindowClosing(evt); + } + }); + + splitter.setDividerLocation(300); + + txtText.setColumns(20); + txtText.setRows(5); + txtText.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyPressed(java.awt.event.KeyEvent evt) { + txtTextKeyPressed(evt); + } + }); + textScroller.setViewportView(txtText); + + cboFonts.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); + cboFonts.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cboFontsActionPerformed(evt); + } + }); + + slideFontSize.setMajorTickSpacing(32); + slideFontSize.setMaximum(256); + slideFontSize.setMinimum(8); + slideFontSize.setMinorTickSpacing(8); + slideFontSize.setPaintLabels(true); + slideFontSize.setPaintTicks(true); + slideFontSize.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideFontSizeMouseDragged(evt); + } + }); + slideFontSize.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideFontSizeMouseDragged(evt); + } + }); + + panFGGroup.setLayout(new javax.swing.BoxLayout(panFGGroup, javax.swing.BoxLayout.PAGE_AXIS)); + + slideFGRed.setMaximum(255); + slideFGRed.setBorder(javax.swing.BorderFactory.createTitledBorder("Red")); + slideFGRed.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideTextForegroundColor(evt); + } + }); + slideFGRed.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideTextForegroundColor(evt); + } + }); + panFGGroup.add(slideFGRed); + + slideFGGreen.setMaximum(255); + slideFGGreen.setBorder(javax.swing.BorderFactory.createTitledBorder("Green")); + slideFGGreen.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideTextForegroundColor(evt); + } + }); + slideFGGreen.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideTextForegroundColor(evt); + } + }); + panFGGroup.add(slideFGGreen); + + slideFGBlue.setMaximum(255); + slideFGBlue.setBorder(javax.swing.BorderFactory.createTitledBorder("Blue")); + slideFGBlue.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideTextForegroundColor(evt); + } + }); + slideFGBlue.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideTextForegroundColor(evt); + } + }); + panFGGroup.add(slideFGBlue); + + slideFGAlpha.setMaximum(255); + slideFGAlpha.setValue(255); + slideFGAlpha.setBorder(javax.swing.BorderFactory.createTitledBorder("Alpha")); + slideFGAlpha.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideTextForegroundColor(evt); + } + }); + slideFGAlpha.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideTextForegroundColor(evt); + } + }); + panFGGroup.add(slideFGAlpha); + + tabsColor.addTab("Foreground", panFGGroup); + + panBGGroup.setLayout(new javax.swing.BoxLayout(panBGGroup, javax.swing.BoxLayout.Y_AXIS)); + + slideBGRed.setMaximum(255); + slideBGRed.setBorder(javax.swing.BorderFactory.createTitledBorder("Red")); + slideBGRed.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideBGColor(evt); + } + }); + slideBGRed.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideBGColor(evt); + } + }); + panBGGroup.add(slideBGRed); + + slideBGGreen.setMaximum(255); + slideBGGreen.setBorder(javax.swing.BorderFactory.createTitledBorder("Green")); + slideBGGreen.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideBGColor(evt); + } + }); + slideBGGreen.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideBGColor(evt); + } + }); + panBGGroup.add(slideBGGreen); + + slideBGBlue.setMaximum(255); + slideBGBlue.setBorder(javax.swing.BorderFactory.createTitledBorder("Blue")); + slideBGBlue.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideBGColor(evt); + } + }); + slideBGBlue.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideBGColor(evt); + } + }); + panBGGroup.add(slideBGBlue); + + slideBGAlpha.setMaximum(255); + slideBGAlpha.setValue(255); + slideBGAlpha.setBorder(javax.swing.BorderFactory.createTitledBorder("Alpha")); + slideBGAlpha.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideBGColor(evt); + } + }); + slideBGAlpha.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideBGColor(evt); + } + }); + panBGGroup.add(slideBGAlpha); + + tabsColor.addTab("Shadow", panBGGroup); + + panBGGroupArea.setLayout(new javax.swing.BoxLayout(panBGGroupArea, javax.swing.BoxLayout.Y_AXIS)); + + slideBGRedArea.setMaximum(255); + slideBGRedArea.setBorder(javax.swing.BorderFactory.createTitledBorder("Red")); + slideBGRedArea.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideBGAreaColor(evt); + } + }); + slideBGRedArea.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideBGAreaColor(evt); + } + }); + panBGGroupArea.add(slideBGRedArea); + + slideBGGreenArea.setMaximum(255); + slideBGGreenArea.setBorder(javax.swing.BorderFactory.createTitledBorder("Green")); + slideBGGreenArea.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideBGAreaColor(evt); + } + }); + slideBGGreenArea.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideBGAreaColor(evt); + } + }); + panBGGroupArea.add(slideBGGreenArea); + + slideBGBlueArea.setMaximum(255); + slideBGBlueArea.setBorder(javax.swing.BorderFactory.createTitledBorder("Blue")); + slideBGBlueArea.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideBGAreaColor(evt); + } + }); + slideBGBlueArea.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideBGAreaColor(evt); + } + }); + panBGGroupArea.add(slideBGBlueArea); + + slideBGAlphaArea.setMaximum(255); + slideBGAlphaArea.setValue(255); + slideBGAlphaArea.setBorder(javax.swing.BorderFactory.createTitledBorder("Alpha")); + slideBGAlphaArea.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + slideBGAreaColor(evt); + } + }); + slideBGAlphaArea.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + slideBGAreaColor(evt); + } + }); + panBGGroupArea.add(slideBGAlphaArea); + + tabsColor.addTab("Background", panBGGroupArea); + + javax.swing.GroupLayout panEditorLayout = new javax.swing.GroupLayout(panEditor); + panEditor.setLayout(panEditorLayout); + panEditorLayout.setHorizontalGroup( + panEditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panEditorLayout.createSequentialGroup() + .addContainerGap() + .addGroup(panEditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(textScroller, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE) + .addComponent(cboFonts, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(slideFontSize, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(tabsColor)) + .addContainerGap()) + ); + panEditorLayout.setVerticalGroup( + panEditorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(panEditorLayout.createSequentialGroup() + .addContainerGap() + .addComponent(textScroller, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cboFonts, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(slideFontSize, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(tabsColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + splitter.setLeftComponent(panEditor); + + panViewer.setBackground(new java.awt.Color(0, 0, 0)); + panViewer.setLayout(new java.awt.BorderLayout()); + scrollViewer.setViewportView(panViewer); + + splitter.setRightComponent(scrollViewer); + + getContentPane().add(splitter, java.awt.BorderLayout.CENTER); + + mnuTags.setText("Tags"); + jMenuBar1.add(mnuTags); + + setJMenuBar(jMenuBar1); + + pack(); + }// //GEN-END:initComponents + + private void txtTextKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtTextKeyPressed + mTextViewer.setText((txtText.getText() + evt.getKeyChar()).trim()); + mText.setText((txtText.getText() + evt.getKeyChar()).trim()); + }//GEN-LAST:event_txtTextKeyPressed + + private void cboFontsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboFontsActionPerformed + if (mSource != null) { + mSource.setFont(new Font(cboFonts.getSelectedItem().toString(), Font.PLAIN, slideFontSize.getValue())); + mText.setFontName(cboFonts.getSelectedItem().toString()); + } + }//GEN-LAST:event_cboFontsActionPerformed + + private void slideFontSizeMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_slideFontSizeMouseDragged + if (mSource != null) { + mSource.setFont(new Font(cboFonts.getSelectedItem().toString(), Font.PLAIN, slideFontSize.getValue())); + mText.setFontSize(slideFontSize.getValue()); + } + }//GEN-LAST:event_slideFontSizeMouseDragged + + private void slideTextForegroundColor(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_slideTextForegroundColor + setTextForeground(); + }//GEN-LAST:event_slideTextForegroundColor + + private void slideBGColor(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_slideBGColor + setTextBackground(); + }//GEN-LAST:event_slideBGColor + + private void slideBGAreaColor(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_slideBGAreaColor + setTextBackgroundArea(); + + }//GEN-LAST:event_slideBGAreaColor + + private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing + try { + mTextViewer.finalize(); + } catch (Throwable ex) { + Logger.getLogger(TextEditor.class.getName()).log(Level.SEVERE, null, ex); + } + + }//GEN-LAST:event_formWindowClosing + + private void setTextForeground() { + if (mSource != null) { + int c = (slideFGAlpha.getValue() << 24) + (slideFGRed.getValue() << 16) + (slideFGGreen.getValue() << 8) + slideFGBlue.getValue(); + mSource.setForeground(c); + mText.setForegroundColor(c); + } + } + + private void setTextBackground() { + if (mSource != null) { + int c = (slideBGAlpha.getValue() << 24) + (slideBGRed.getValue() << 16) + (slideBGGreen.getValue() << 8) + slideBGBlue.getValue(); + mSource.setBackground(c); + mText.setBackgroundColor(c); + } + } + + private void setTextBackgroundArea() { + if (mSource != null) { + int c = (slideBGAlphaArea.getValue() << 24) + (slideBGRedArea.getValue() << 16) + (slideBGGreenArea.getValue() << 8) + slideBGBlueArea.getValue(); + mSource.setBackgroundArea(c); + mText.setBackgroundAreaColor(c); + } + } + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JComboBox cboFonts; + private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JMenu mnuTags; + private javax.swing.JPanel panBGGroup; + private javax.swing.JPanel panBGGroupArea; + private javax.swing.JPanel panEditor; + private javax.swing.JPanel panFGGroup; + private javax.swing.JPanel panViewer; + private javax.swing.JScrollPane scrollViewer; + private javax.swing.JSlider slideBGAlpha; + private javax.swing.JSlider slideBGAlphaArea; + private javax.swing.JSlider slideBGBlue; + private javax.swing.JSlider slideBGBlueArea; + private javax.swing.JSlider slideBGGreen; + private javax.swing.JSlider slideBGGreenArea; + private javax.swing.JSlider slideBGRed; + private javax.swing.JSlider slideBGRedArea; + private javax.swing.JSlider slideFGAlpha; + private javax.swing.JSlider slideFGBlue; + private javax.swing.JSlider slideFGGreen; + private javax.swing.JSlider slideFGRed; + private javax.swing.JSlider slideFontSize; + private javax.swing.JSplitPane splitter; + private javax.swing.JTabbedPane tabsColor; + private javax.swing.JScrollPane textScroller; + private javax.swing.JTextArea txtText; + // End of variables declaration//GEN-END:variables +} diff -Nru screenstudio-3.4.0/src/screenstudio/panel/editor/TextViewer.form screenstudio-3.4.1/src/screenstudio/panel/editor/TextViewer.form --- screenstudio-3.4.0/src/screenstudio/panel/editor/TextViewer.form 1970-01-01 00:00:00.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/panel/editor/TextViewer.form 2017-06-08 19:26:47.000000000 +0000 @@ -0,0 +1,40 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff -Nru screenstudio-3.4.0/src/screenstudio/panel/editor/TextViewer.java screenstudio-3.4.1/src/screenstudio/panel/editor/TextViewer.java --- screenstudio-3.4.0/src/screenstudio/panel/editor/TextViewer.java 1970-01-01 00:00:00.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/panel/editor/TextViewer.java 2017-06-08 19:26:47.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2017 patrick + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package screenstudio.panel.editor; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import java.util.logging.Level; +import java.util.logging.Logger; +import screenstudio.sources.SourceText; + +/** + * + * @author patrick + */ +public class TextViewer extends javax.swing.JPanel { + + private final SourceText mSource; + + /** + * Creates new form TextViewer + * + * @param source + */ + public TextViewer(SourceText source) { + initComponents(); + mSource = source; + new Thread(mSource).start(); + new Thread(new Runnable() { + @Override + public void run() { + while (mSource != null) { + repaint(); + try { + Thread.sleep(200); + } catch (InterruptedException ex) { + Logger.getLogger(TextViewer.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + }).start(); + } + + public void setText(String text) { + if (mSource != null) { + mSource.setText(text); + } + } + + @Override + public void paint(Graphics g) { + super.paint(g); + if (mSource != null) { + BufferedImage img = mSource.getImage(); + g.drawImage(img, 5, 15, null); + g.setColor(Color.red); + g.drawRect(5,15,img.getWidth(),img.getHeight()); + } + } + + @Override + public void finalize() throws Throwable { + try { + mSource.stop(); + } finally { + super.finalize(); + } + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + setBackground(new java.awt.Color(0, 0, 0)); + setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Preview", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 12), new java.awt.Color(238, 238, 238))); // NOI18N + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 390, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 278, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables +} diff -Nru screenstudio-3.4.0/src/screenstudio/sources/Compositor.java screenstudio-3.4.1/src/screenstudio/sources/Compositor.java --- screenstudio-3.4.0/src/screenstudio/sources/Compositor.java 2017-05-14 05:07:04.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/sources/Compositor.java 2017-06-08 19:26:47.000000000 +0000 @@ -16,7 +16,6 @@ */ package screenstudio.sources; -import java.awt.Color; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.image.BufferedImage; @@ -193,7 +192,8 @@ s.setViewIndex(sources.get(i).getCurrentViewIndex()); list.add(s); } else if (source instanceof LabelText) { - SourceLabel s = new SourceLabel(sources.get(i).getViews(), ((LabelText) source)); + LabelText t = (LabelText)source; + SourceText s = new SourceText(sources.get(i).getViews(),t); s.setDisplayTime(timestart, timeend); s.setTransitionStart(transIn); s.setTransitionStop(transOut); diff -Nru screenstudio-3.4.0/src/screenstudio/sources/SourceText.java screenstudio-3.4.1/src/screenstudio/sources/SourceText.java --- screenstudio-3.4.0/src/screenstudio/sources/SourceText.java 1970-01-01 00:00:00.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/sources/SourceText.java 2017-06-08 19:26:47.000000000 +0000 @@ -0,0 +1,381 @@ +/* + * Copyright (C) 2017 patrick + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package screenstudio.sources; + +import screenstudio.gui.LabelText; +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferByte; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.text.DateFormat; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author patrick + */ +public class SourceText extends Source implements Runnable { + + private final BufferedImage mImage; + private String mText; + private String mRawText; + private boolean mStopMe = false; + private final long mStartTimeStamp = System.currentTimeMillis(); + private boolean mOnChangeOnly = false; + private boolean mOneLiner = false; + private long mReloadTime = 1000; + private long mLastReloadTime = System.currentTimeMillis(); + private final byte[] mData; + private int mBackgroundArea; + private Font mFont; + private byte[] mBuffer; + private boolean mScrollVertical = false; + private boolean mScrollHorizontal = false; + private boolean mTypeWriterMode = false; + private int mLastLineIndex = 0; + private long mLastLineTime = 0; + private int mRotation = 0; + + private final DateFormat formatDate = DateFormat.getDateInstance(DateFormat.SHORT, Locale.getDefault()); + private final DateFormat formatTime = DateFormat.getTimeInstance(DateFormat.LONG, Locale.getDefault()); + + public SourceText(List views, Rectangle size, Color fg, Color bg, Color areabg, Color rect, String text, Font f, String id) { + super(views, 0, id, BufferedImage.TYPE_4BYTE_ABGR); + mImage = new BufferedImage(size.width, size.height, mImageType); + mBounds = size; + mData = ((DataBufferByte) mImage.getRaster().getDataBuffer()).getData(); + mBuffer = new byte[mData.length]; + System.arraycopy(mData, 0, mBuffer, 0, mBuffer.length); + mRawText = text; + mText = updateWithTextTags(text); + mForeground = fg.getRGB(); + mBackground = bg.getRGB(); + mBackgroundArea = areabg.getRGB(); + mFont = f; + } + + public SourceText(List views, LabelText text) { + super(views, 0, "", BufferedImage.TYPE_4BYTE_ABGR); + mImage = new BufferedImage(views.get(0).Width, views.get(0).Height, mImageType); + mData = ((DataBufferByte) mImage.getRaster().getDataBuffer()).getData(); + mBuffer = new byte[mData.length]; + System.arraycopy(mData, 0, mBuffer, 0, mBuffer.length); + mRawText = text.getText(); + mText = updateWithTextTags(mRawText); + mForeground = text.getForegroundColor(); + mBackground = text.getBackgroundColor(); + mBackgroundArea = text.getBackgroundAreaColor(); + mFont = new Font(text.getFontName(), Font.PLAIN, text.getFontSize()); + } + + @Override + protected void getData(byte[] buffer) throws IOException { + System.arraycopy(mBuffer, 0, buffer, 0, buffer.length); + } + + @Override + protected void initStream() throws IOException { + mStopMe = false; + new Thread(this).start(); + } + + @Override + protected void disposeStream() throws IOException { + mStopMe = true; + } + + public void setText(String text) { + mRawText = text; + mText = updateWithTextTags(text); + } + + public void setFont(Font f) { + mFont = f; + } + + public void setForeground(int color) { + mForeground = color; + } + + public void setBackground(int color) { + mBackground = color; + } + + public void setBackgroundArea(int color) { + mBackgroundArea = color; + } + + @Override + public void run() { + int xRelative = 0; + int yRelative = 0; + int lastEndIndex = 1; + int lastStartIndex = 0; + boolean changeLineIndex = false; + long lastIndexTime = System.currentTimeMillis(); + mLastLineTime = System.currentTimeMillis() + 5000; + + while (!mStopMe) { + Graphics2D g = mImage.createGraphics(); + g.setFont(mFont); + if (System.currentTimeMillis() - mLastReloadTime > mReloadTime) { + mText = updateWithTextTags(mRawText); + mLastReloadTime = System.currentTimeMillis(); + } + String content = replaceTags(mText); + if (mOneLiner) { + String[] temp = content.split("\n"); + if (mLastLineIndex >= temp.length) { + mLastLineIndex = 0; + } + content = temp[mLastLineIndex].trim(); + if (System.currentTimeMillis() - mLastLineTime > 5000) { + mLastLineTime = System.currentTimeMillis() + 5000; + mLastLineIndex++; + if (mLastLineIndex >= temp.length) { + mLastLineIndex = 0; + } + content = temp[mLastLineIndex]; + new Thread(new Runnable() { + @Override + public void run() { + int originalFG = mForeground; + int originalShadow = mBackground; + mForeground = 0x00FFFFFF & mForeground; + mBackground = 0x00FFFFFF & mBackground; + for (int i = 0; i < 255; i++) { + try { + mForeground = (i << 24) | (0x00FFFFFF & mForeground); + mBackground = (i << 24) | (0x00FFFFFF & mBackground); + Thread.sleep(2000 / 255); + } catch (InterruptedException ex) { + Logger.getLogger(SourceText.class.getName()).log(Level.SEVERE, null, ex); + } + } + mForeground = originalFG; + mBackground = originalShadow; + } + }).start(); + } + + } + + if (mTypeWriterMode) { + if (System.currentTimeMillis() - lastIndexTime > 100) { + if (changeLineIndex) { + if (lastEndIndex >= content.length()) { + lastEndIndex = 1; + lastStartIndex = 0; + } else if (content.charAt(lastEndIndex) == '\n') { + lastStartIndex = lastEndIndex + 1; + lastEndIndex += 1; + } + changeLineIndex = false; + } else { + lastEndIndex++; + if (lastEndIndex >= content.length()) { + changeLineIndex = true; + lastIndexTime = System.currentTimeMillis() + 3000; + } else if (content.charAt(lastEndIndex) == '\n') { + changeLineIndex = true; + lastIndexTime = System.currentTimeMillis() + 3000; + } else { + lastIndexTime = System.currentTimeMillis(); + } + } + } + if (lastEndIndex <= content.length()) { + content = content.substring(lastStartIndex, lastEndIndex); + } + } + java.util.Arrays.fill(mData, (byte) 0); + String[] lines = content.split("\n"); + if (lines.length > 0) { + g.setColor(new Color(mBackgroundArea, true)); + g.fillRect(0, 0, mImage.getWidth(), mImage.getHeight()); + if (mScrollHorizontal) { + xRelative -= 2; + } else { + xRelative = 0; + } + if (mScrollVertical) { + yRelative -= 2; + } else { + yRelative = 0; + } + int x = xRelative; + int y = g.getFontMetrics().getStringBounds(lines[0], g).getBounds().height + yRelative; + for (String line : lines) { + line = line.trim(); + Rectangle2D size = g.getFontMetrics().getStringBounds(line, g); + g.setColor(new Color(mBackground, true)); + g.drawString(line, x, y); + g.drawString(line, x - 1, y - 1); + g.setColor(new Color(mForeground, true)); + g.drawString(line, x - 2, y - 2); + if (mScrollHorizontal) { + x += size.getWidth() + g.getFontMetrics().stringWidth(" "); + } else { + y += size.getHeight(); + } + } + if (mScrollVertical && y < 0) { + yRelative = mImage.getHeight(); + } + if (mScrollHorizontal && x < 0) { + xRelative = mImage.getWidth(); + } + } + mBuffer = new byte[mData.length]; + System.arraycopy(mData, 0, mBuffer, 0, mBuffer.length); + g.dispose(); + try { + Thread.sleep(100); + } catch (InterruptedException ex) { + Logger.getLogger(SourceText.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + private String replaceTags(String text) { + String retValue = text.trim() + ""; + + int index = retValue.indexOf("file:///"); + while (index != -1) { + int toIndex = retValue.indexOf(";", index); + if (toIndex == -1) { + toIndex = retValue.indexOf(" ", index); + } + if (toIndex == -1) { + toIndex = retValue.indexOf("\n", index); + } + if (toIndex == -1) { + toIndex = retValue.length() - 1; + } + if (toIndex != -1) { + String file = retValue.substring(index, toIndex + 1); + retValue = retValue.replaceAll(file, getFileContent(new File(retValue.substring(index + 6, toIndex)))); + index = retValue.indexOf("file:///", toIndex + 1); + } else { + index = retValue.indexOf("file:///", index + 1); + } + } + retValue = retValue.replaceAll("@CURRENTDATE", formatDate.format(new Date())); + retValue = retValue.replaceAll("@CURRENTTIME", formatTime.format(new Date())); + retValue = retValue.replaceAll("@RECORDINGTIME", ((System.currentTimeMillis() - mStartTimeStamp) / 1000 / 60) + " min"); + retValue = retValue.replaceAll("@STARTTIME", formatTime.format(new Date(mStartTimeStamp))); + return retValue; + } + + private String getFileContent(File file) { + String text = ""; + if (file.exists()) { + try { + InputStream in = file.toURI().toURL().openStream(); + byte[] data = new byte[(int) file.length()]; + in.read(data); + in.close(); + text = new String(data).trim(); + + } catch (IOException ex) { + Logger.getLogger(SourceText.class.getName()).log(Level.SEVERE, null, ex); + } + } + return text; + } + + private String updateWithTextTags(String text) { + String retValue = text + ""; + int index = retValue.indexOf("@UPDATE"); + if (index != -1) { + int toIndex = retValue.indexOf("MIN@"); + if (toIndex == -1) { + toIndex = retValue.indexOf("SEC@"); + } + if (toIndex != -1) { + String update = retValue.substring(index, toIndex + 4); + try { + String intValue = update.replaceAll("@UPDATE", "").replaceAll(" ", "").replaceAll("MIN@", "").replaceAll("SEC@", ""); + int value = new Integer(intValue.trim()); + if (update.endsWith("MIN@")) { + value = value * 60000; + } else if (update.endsWith("SEC@")) { + value = value * 1000; + } + mReloadTime = value; + retValue = retValue.replaceAll(update, ""); + } catch (Exception ex) { + System.err.println("Parsing update value failed:" + ex.getMessage()); + } + } + } + mOnChangeOnly = false; + index = retValue.indexOf("@ONCHANGEONLY"); + if (index != -1) { + setAlpha(0); + mOnChangeOnly = true; + retValue = retValue.replaceAll("@ONCHANGEONLY", ""); + } + mOneLiner = false; + index = retValue.indexOf("@ONELINER"); + if (index != -1) { + mOneLiner = true; + retValue = retValue.replaceAll("@ONELINER", ""); + } + mScrollVertical = false; + mScrollHorizontal = false; + index = retValue.indexOf("@SCROLLVERTICAL"); + if (index != -1) { + mScrollVertical = true; + retValue = retValue.replaceAll("@SCROLLVERTICAL", ""); + } + index = retValue.indexOf("@SCROLLHORIZONTAL"); + if (index != -1) { + mScrollHorizontal = true; + retValue = retValue.replaceAll("@SCROLLHORIZONTAL", ""); + } + mTypeWriterMode = false; + index = retValue.indexOf("@TYPEWRITER"); + if (index != -1) { + mTypeWriterMode = true; + retValue = retValue.replaceAll("@TYPEWRITER", ""); + } + mRotation = 0; + index = retValue.indexOf("@ROTATE90"); + if (index != -1) { + mRotation = 90; + retValue = retValue.replaceAll("@ROTATE90", ""); + } + index = retValue.indexOf("@ROTATE270"); + if (index != -1) { + mRotation = 270; + retValue = retValue.replaceAll("@ROTATE270", ""); + } + return retValue.trim(); + } + +} diff -Nru screenstudio-3.4.0/src/screenstudio/targets/Layout.java screenstudio-3.4.1/src/screenstudio/targets/Layout.java --- screenstudio-3.4.0/src/screenstudio/targets/Layout.java 2017-05-14 05:07:04.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/targets/Layout.java 2017-06-08 19:26:47.000000000 +0000 @@ -269,7 +269,7 @@ Node node = document.createElement(nodeName); Node capx = document.createAttribute("capturex"); Node capy = document.createAttribute("capturey"); - + //This is for the layouts for (Source.View v : source.getViews()) { @@ -308,7 +308,9 @@ Node type = document.createAttribute("type"); Node foreg = document.createAttribute("fg"); Node backg = document.createAttribute("bg"); + Node backgroundAreaColor = document.createAttribute("bgAreaColor"); Node fontg = document.createAttribute("font"); + Node fontSize = document.createAttribute("fontsize"); Node timeStart = document.createAttribute("start"); Node timeEnd = document.createAttribute("end"); Node transitionStart = document.createAttribute("transstart"); @@ -321,7 +323,9 @@ id.setNodeValue("" + source.getID()); foreg.setNodeValue("" + source.getForegroundColor()); backg.setNodeValue("" + source.getBackgroundColor()); + backgroundAreaColor.setNodeValue(""+source.getBackgroundAreaColor()); fontg.setNodeValue(source.getFontName()); + fontSize.setNodeValue(""+source.getFontSize()); timeStart.setNodeValue(source.getStartTime() + ""); timeEnd.setNodeValue(source.getEndTime() + ""); transitionStart.setNodeValue(source.getTransitionStart().name()); @@ -335,7 +339,7 @@ type.setNodeValue(""); break; } - + node.getAttributes().setNamedItem(capx); node.getAttributes().setNamedItem(capy); node.getAttributes().setNamedItem(id); @@ -348,6 +352,8 @@ node.getAttributes().setNamedItem(transitionStart); node.getAttributes().setNamedItem(transitionStop); node.getAttributes().setNamedItem(effectFilter); + node.getAttributes().setNamedItem(backgroundAreaColor); + node.getAttributes().setNamedItem(fontSize); root.appendChild(node); } @@ -392,6 +398,17 @@ } else { s.setEffect(Effect.eEffects.None); } + if (n.getAttributes().getNamedItem("fontsize") != null) { + s.setFontSize(Integer.parseInt(n.getAttributes().getNamedItem("fontsize").getNodeValue())); + } else { + s.setFontSize(20); + } + if (n.getAttributes().getNamedItem("bgAreaColor") != null) { + s.setBackgroundColor(Integer.parseInt(n.getAttributes().getNamedItem("bgAreaColor").getNodeValue())); + } else { + s.setBackgroundColor(0); + } + sources[i] = s; } return sources; @@ -437,6 +454,16 @@ } else { s.setEffect(Effect.eEffects.None); } + if (n.getAttributes().getNamedItem("fontsize") != null) { + s.setFontSize(Integer.parseInt(n.getAttributes().getNamedItem("fontsize").getNodeValue())); + } else { + s.setFontSize(20); + } + if (n.getAttributes().getNamedItem("bgAreaColor") != null) { + s.setBackgroundColor(Integer.parseInt(n.getAttributes().getNamedItem("bgAreaColor").getNodeValue())); + } else { + s.setBackgroundColor(0); + } sources[i] = s; } return sources; @@ -477,6 +504,16 @@ s.setEffect(Effect.eEffects.None); } sources[i] = s; + if (n.getAttributes().getNamedItem("fontsize") != null) { + s.setFontSize(Integer.parseInt(n.getAttributes().getNamedItem("fontsize").getNodeValue())); + } else { + s.setFontSize(20); + } + if (n.getAttributes().getNamedItem("bgAreaColor") != null) { + s.setBackgroundColor(Integer.parseInt(n.getAttributes().getNamedItem("bgAreaColor").getNodeValue())); + } else { + s.setBackgroundColor(0); + } } return sources; } @@ -488,6 +525,7 @@ list.addAll(Arrays.asList(getDesktops())); list.addAll(Arrays.asList(getLabels())); list.addAll(Arrays.asList(getFrames())); + list.addAll(Arrays.asList(getCustoms())); list.sort((Source o1, Source o2) -> o1.getViews().get(o1.getCurrentViewIndex()).Order - o2.getViews().get(o2.getCurrentViewIndex()).Order); return list; } @@ -543,6 +581,16 @@ } else { s.setEffect(Effect.eEffects.None); } + if (n.getAttributes().getNamedItem("fontsize") != null) { + s.setFontSize(Integer.parseInt(n.getAttributes().getNamedItem("fontsize").getNodeValue())); + } else { + s.setFontSize(20); + } + if (n.getAttributes().getNamedItem("bgAreaColor") != null) { + s.setBackgroundColor(Integer.parseInt(n.getAttributes().getNamedItem("bgAreaColor").getNodeValue())); + } else { + s.setBackgroundColor(0); + } sources[i] = s; } return sources; @@ -582,6 +630,16 @@ } else { s.setEffect(Effect.eEffects.None); } + if (n.getAttributes().getNamedItem("fontsize") != null) { + s.setFontSize(Integer.parseInt(n.getAttributes().getNamedItem("fontsize").getNodeValue())); + } else { + s.setFontSize(20); + } + if (n.getAttributes().getNamedItem("bgAreaColor") != null) { + s.setBackgroundColor(Integer.parseInt(n.getAttributes().getNamedItem("bgAreaColor").getNodeValue())); + } else { + s.setBackgroundColor(0); + } sources[i] = s; } return sources; @@ -629,6 +687,16 @@ } else { s.setEffect(Effect.eEffects.None); } + if (n.getAttributes().getNamedItem("fontsize") != null) { + s.setFontSize(new Integer(n.getAttributes().getNamedItem("fontsize").getNodeValue())); + } else { + s.setFontSize(20); + } + if (n.getAttributes().getNamedItem("bgAreaColor") != null) { + s.setBackgroundAreaColor(new Integer(n.getAttributes().getNamedItem("bgAreaColor").getNodeValue())); + } else { + s.setBackgroundAreaColor(0); + } sources[i] = s; } return sources; diff -Nru screenstudio-3.4.0/src/screenstudio/targets/Source.java screenstudio-3.4.1/src/screenstudio/targets/Source.java --- screenstudio-3.4.0/src/screenstudio/targets/Source.java 2017-05-14 05:07:04.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/targets/Source.java 2017-06-08 19:26:47.000000000 +0000 @@ -29,7 +29,10 @@ public int CaptureY; public int foregroundColor; public int backgroundColor; + public int backgroundAreaColor; public String fontName; + public int fontSize; + public long startTime; public long endTime; public Transition.NAMES transitionStart = Transition.NAMES.None; @@ -320,6 +323,18 @@ Views.get(CurrentViewIndex).Order = o; } + public void setFontSize(int s){ + fontSize = s; + } + public int getFontSize(){ + return fontSize; + } + public void setBackgroundAreaColor(int c){ + backgroundAreaColor = c; + } + public int getBackgroundAreaColor(){ + return backgroundAreaColor; + } public static class View { public String ViewName = "View"; diff -Nru screenstudio-3.4.0/src/screenstudio/Version.java screenstudio-3.4.1/src/screenstudio/Version.java --- screenstudio-3.4.0/src/screenstudio/Version.java 2017-05-14 05:07:04.000000000 +0000 +++ screenstudio-3.4.1/src/screenstudio/Version.java 2017-06-08 19:26:47.000000000 +0000 @@ -28,7 +28,7 @@ //Using this to set the main version of ScreenStudio - public final static String MAIN = "3.4.0"; + public final static String MAIN = "3.4.1"; public static boolean hasNewVersion() { boolean retValue = false;