End of variables declaration//GEN-END:variables
428822
public String getSVGString(int width){
        StringBuffer out = new StringBuffer();

        int x = (int)(point.value(x_dim)*window_size);
        int y = (int)(point.value(y_dim)*window_size);
        int radius = panel_size/2;
        //radius = 1;

        Color c = getColor();

        String color = "rgb("+c.getRed()+","+c.getGreen()+","+c.getBlue()+")";
        double trans = c.getAlpha()/255.0;

        out.append("<circle ");
        out.append("cx='"+x+"' cy='"+y+"' r='"+radius+"'");
        out.append(" stroke='"+color+"' stroke-width='0' fill='"+color+"' fill-opacity='"+trans+"' stroke-opacity='"+trans+"'/>");
        out.append("\n");
        return out.toString();
    }
73261
@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPaneAlgorithms = new javax.swing.JScrollPane();
        jTableAlgoritms = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTableStreams = new javax.swing.JTable();
        jTextFieldResultPath = new javax.swing.JTextField();
        jButtonInPath = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        jButtonDeletAlgorithm = new javax.swing.JButton();
        jButtonDeleteStream = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jButtonAcept = new javax.swing.JButton();
        jButtonReset = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel4 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        jTextFieldxTitle = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jTextFieldyTitle = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jComboBoxXColumn = new javax.swing.JComboBox();
        jComboBoxYColumn = new javax.swing.JComboBox();
        jTextFieldTitle = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        jSpinnerWidth = new javax.swing.JSpinner();
        jSpinnerHeight = new javax.swing.JSpinner();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jComboBoxGrid = new javax.swing.JComboBox();
        jCheckBoxShape = new javax.swing.JCheckBox();
        jLabel2 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jButtonAceptGnuP = new javax.swing.JButton();
        jButtonResetGnuP = new javax.swing.JButton();
        jScrollPaneGnuP = new javax.swing.JScrollPane();
        jPanelGnuP = new javax.swing.JPanel();
        jTextFieldGNUPath = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jButtonGnuoPath = new javax.swing.JButton();
        jComboBoxOutPTypeGnuP = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        jComboBoxLineStyle = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jTextFieldxTitleGnuP = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jTextFieldyTitleGnuP = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jSpinnerLineWidth = new javax.swing.JSpinner();
        jSpinnerPlotInterval = new javax.swing.JSpinner();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jCheckBoxSmooth = new javax.swing.JCheckBox();
        jLabel15 = new javax.swing.JLabel();
        jCheckBoxDeleteScript = new javax.swing.JCheckBox();
        jLabel16 = new javax.swing.JLabel();
        jComboBoxLegendLocation = new javax.swing.JComboBox();
        jLabel24 = new javax.swing.JLabel();
        jComboBoxLegendType = new javax.swing.JComboBox();
        jLabel25 = new javax.swing.JLabel();
        jTextFieldAdcComand = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        jTextFieldAPOptions = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jComboBoxXColumnGnuP = new javax.swing.JComboBox();
        jComboBoxYColumnGnuP = new javax.swing.JComboBox();

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Configuration"));

        jScrollPaneAlgorithms.setBorder(javax.swing.BorderFactory.createTitledBorder("Algorithm"));

        jTableAlgoritms.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jTableAlgoritms.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Algorithm", "Algorithm ID"
            }
        ));
        jScrollPaneAlgorithms.setViewportView(jTableAlgoritms);

        jScrollPane3.setBorder(javax.swing.BorderFactory.createTitledBorder("Stream"));

        jTableStreams.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jTableStreams.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Stream", "Stream ID"
            }
        ));
        jScrollPane3.setViewportView(jTableStreams);

        jButtonInPath.setText("Browse");
        jButtonInPath.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonInPathActionPerformed(evt);
            }
        });

        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel3.setText("Result  folder");

        jButtonDeletAlgorithm.setText("Delete Algorithm");
        jButtonDeletAlgorithm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDeletAlgorithmActionPerformed(evt);
            }
        });

        jButtonDeleteStream.setText("Delete Stream");
        jButtonDeleteStream.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDeleteStreamActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(14, 14, 14)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldResultPath)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButtonInPath))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonDeletAlgorithm)
                            .addComponent(jScrollPaneAlgorithms, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jButtonDeleteStream)
                                .addGap(0, 0, Short.MAX_VALUE)))))
                .addGap(16, 16, 16))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldResultPath, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonInPath)
                    .addComponent(jLabel3))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPaneAlgorithms, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonDeleteStream)
                    .addComponent(jButtonDeletAlgorithm)))
        );

        jButtonAcept.setText("Generate Images");
        jButtonAcept.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAceptActionPerformed(evt);
            }
        });

        jButtonReset.setText(" Reset to Default");
        jButtonReset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonResetActionPerformed(evt);
            }
        });

        jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel17.setText("xColumn");

        jTextFieldxTitle.setText("Instances processed");

        jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel18.setText("xTitle");

        jLabel19.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel19.setText("yColumn");

        jTextFieldyTitle.setText("% of correctly classified");

        jLabel20.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel20.setText("yTitle");

        jLabel21.setText("title");

        jSpinnerWidth.setValue(500);

        jSpinnerHeight.setValue(300);

        jLabel22.setText("width");

        jLabel23.setText("height");

        jComboBoxGrid.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "White", "Default" }));

        jCheckBoxShape.setText("shapes");

        jLabel2.setText("gridColor");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(67, 67, 67)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel17)
                                .addComponent(jLabel21)
                                .addComponent(jLabel18))
                            .addComponent(jLabel19)
                            .addComponent(jLabel20, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel22, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldxTitle)
                            .addComponent(jComboBoxXColumn, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jTextFieldTitle, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jComboBoxYColumn, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jTextFieldyTitle, javax.swing.GroupLayout.DEFAULT_SIZE, 542, Short.MAX_VALUE)
                            .addComponent(jSpinnerWidth)))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel23)
                            .addComponent(jLabel2))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jCheckBoxShape, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(jComboBoxGrid, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSpinnerHeight))))
                .addGap(30, 30, 30))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxXColumn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldxTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxYColumn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldyTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSpinnerWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(jSpinnerHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxGrid, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jCheckBoxShape)
                .addContainerGap(11, Short.MAX_VALUE))
        );

        jScrollPane1.setViewportView(jPanel4);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(135, 135, 135)
                .addComponent(jButtonAcept)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonReset)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 700, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonAcept)
                    .addComponent(jButtonReset)))
        );

        jTabbedPane1.addTab("Charts", jPanel2);

        jButtonAceptGnuP.setText("Generate GnuPlot Commands");
        jButtonAceptGnuP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAceptGnuPActionPerformed(evt);
            }
        });

        jButtonResetGnuP.setText(" Reset to Default");
        jButtonResetGnuP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonResetGnuPActionPerformed(evt);
            }
        });

        jScrollPaneGnuP.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jScrollPaneGnuP.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

        jPanelGnuP.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanelGnuP.setPreferredSize(new java.awt.Dimension(400, 449));

        jTextFieldGNUPath.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldGNUPathActionPerformed(evt);
            }
        });

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel1.setText("gnuplotBinaryPath ");

        jButtonGnuoPath.setText("Browse");
        jButtonGnuoPath.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGnuoPathActionPerformed(evt);
            }
        });

        jComboBoxOutPTypeGnuP.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "POSTSCRIPT_COLOR", "EPSLATEX", "GIF", "JPEG", "LATEX", "PDFCAIRO", "PNG", "POSTSCRIPT", "CANVAS", "PSLATEX", "PSTEX", "PSTRICKS", "SVG" }));

        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel5.setText("outputType");

        jComboBoxLineStyle.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "LINES", "POINTS", "LINESPOINTS", "IMPULSES", "STEPS", "FSTEPS", "HISTEPS", "DOTS;" }));

        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel6.setText("plotStyle");

        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel7.setText("xColumn");

        jTextFieldxTitleGnuP.setText("Processed instances");

        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel8.setText("xTitle");

        jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel10.setText("yColumn");

        jTextFieldyTitleGnuP.setText("Accuracy");

        jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel11.setText("yTitle");

        jSpinnerLineWidth.setValue(2);

        jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel13.setText("lineWidth");

        jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel14.setText("plotInterval");

        jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel15.setText("smooth");

        jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel16.setText("deleteScripts");

        jComboBoxLegendLocation.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "BOTTOM_CENTER_OUTSIDE", "TOP_LEFT_INSIDE", "TOP_CENTER_INSIDE", "TOP_RIGHT_INSIDE", "LEFT_INSIDE", "CENTER_INSIDE", "RIGHT_INSIDE", "BOTTOM_LEFT_INSIDE", "BOTTOM_CENTER_INSIDE", "BOTTOM_RIGHT_INSIDE", "TOP_LEFT_OUTSIDE", "TOP_CENTER_OUTSIDE", "TOP_RIGHT_OUTSIDE", "LEFT_OUTSIDE", "CENTER_OUTSIDE", "RIGHT_OUTSIDE", "BOTTOM_LEFT_OUTSIDE", "BOTTOM_RIGHT_OUTSIDE" }));
        jComboBoxLegendLocation.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxLegendLocationActionPerformed(evt);
            }
        });

        jLabel24.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel24.setText("legendLocation");

        jComboBoxLegendType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NOBOX_HORIZONTAL", "BOX_VERTICAL", "BOX_HORIZONTAL", "NOBOX_VERTICAL", " " }));

        jLabel25.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel25.setText("legendType");

        jLabel26.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel26.setText("additionalCommands");

        jLabel27.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel27.setText("additionalPlotOptions");

        javax.swing.GroupLayout jPanelGnuPLayout = new javax.swing.GroupLayout(jPanelGnuP);
        jPanelGnuP.setLayout(jPanelGnuPLayout);
        jPanelGnuPLayout.setHorizontalGroup(
            jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelGnuPLayout.createSequentialGroup()
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelGnuPLayout.createSequentialGroup()
                            .addGap(22, 22, 22)
                            .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelGnuPLayout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jLabel27)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelGnuPLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel15, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel16, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel24, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel25, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel26, javax.swing.GroupLayout.Alignment.TRAILING))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldAPOptions, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldAdcComand, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jComboBoxLegendType, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jSpinnerPlotInterval, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jSpinnerLineWidth, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldyTitleGnuP, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTextFieldxTitleGnuP, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jComboBoxLineStyle, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jComboBoxXColumnGnuP, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jComboBoxYColumnGnuP, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jComboBoxLegendLocation, 0, 542, Short.MAX_VALUE)
                    .addGroup(jPanelGnuPLayout.createSequentialGroup()
                        .addComponent(jTextFieldGNUPath)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonGnuoPath))
                    .addGroup(jPanelGnuPLayout.createSequentialGroup()
                        .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jCheckBoxDeleteScript)
                            .addComponent(jCheckBoxSmooth))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jComboBoxOutPTypeGnuP, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanelGnuPLayout.setVerticalGroup(
            jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelGnuPLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldGNUPath, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonGnuoPath)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxOutPTypeGnuP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jComboBoxLineStyle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxXColumnGnuP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldxTitleGnuP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxYColumnGnuP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldyTitleGnuP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinnerLineWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinnerPlotInterval, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jCheckBoxSmooth)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jCheckBoxDeleteScript)
                    .addComponent(jLabel16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxLegendLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBoxLegendType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldAdcComand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelGnuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldAPOptions, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel27))
                .addGap(186, 186, 186))
        );

        jScrollPaneGnuP.setViewportView(jPanelGnuP);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(128, 128, 128)
                .addComponent(jButtonAceptGnuP)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonResetGnuP)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jScrollPaneGnuP, javax.swing.GroupLayout.DEFAULT_SIZE, 700, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPaneGnuP, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonAceptGnuP)
                    .addComponent(jButtonResetGnuP)))
        );

        jTabbedPane1.addTab("GnuPlot", jPanel3);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(7, 7, 7))
        );
    }
1368638
def variable_declaration(self):
        
        self._process(Nature.LET)
        node = VariableDeclaration(assignment=self.assignment())
        self._process(Nature.SEMI)
        return node
749897
private void parseVariableDeclaration() {
        Variable var = new Variable();
        var.setName(tokenizer.consume().getContents());
        tokenizer.consumeExpectedSymbol(":");
        var.setValue(parseExpression(true));
        if (tokenizer.current().isSymbol("!") && tokenizer.next().hasContent("default")) {
            var.setDefaultValue(true);
            tokenizer.consume();
            tokenizer.consume();
        }
        result.addVariable(var);
        tokenizer.consumeExpectedSymbol(";");
    }
1097221
public void setEndings(IntegerArray v) {
    if (FeatureTokens_Type.featOkTst && ((FeatureTokens_Type)jcasType).casFeat_endings == null)
      jcasType.jcas.throwFeatMissing("endings", "ch.epfl.bbp.uima.types.FeatureTokens");
    jcasType.ll_cas.ll_setRefValue(addr, ((FeatureTokens_Type)jcasType).casFeatCode_endings, jcasType.ll_cas.ll_getFSRef(v));}
142003
@Override
    public void endDefinitionList(Map<String, String> parameters)
    {
        getPrinter().println("endDefinitionList" + serializeParameters(parameters));
    }
88255
private void cmdCancelActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_cmdCancelActionPerformed
		parent.setVisible(false);
		parent.dispose();
		releaseResultset();
	}
376808
function filterOutSameLineVars(node) {
            return node.declarations.reduce((finalCollection, elem) => {
                const lastElem = finalCollection[finalCollection.length - 1];

                if ((elem.loc.start.line !== node.loc.start.line && !lastElem) ||
                    (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) {
                    finalCollection.push(elem);
                }

                return finalCollection;
            }, []);
        }
1151375
void endFinalizerGaps(Env<GenContext> from, Env<GenContext> to) {
        Env<GenContext> last = null;
        while (last != to) {
            endFinalizerGap(from);
            last = from;
            from = from.next;
        }
    }
819727
function variables(root, config, done) {
  var expression = /\$v\[(.+?)\]/g;
  each(Object.keys(root), function(key, next) {
    var value = root[key];
    if (typeof value === 'object') return variables(value, config, next);
    if (typeof value !== 'string') return next();
    root[key] = value.replace(expression, function(match, matchKey) {
      return config[matchKey] || match;
    });
    next();
  }, done);
}
608734
function Variable(name, scope) {
        /**  
         * The variable name, as given in the source code.
         * @member {String} Variable#name 
         */
        this.name = name;
        /**
         * List of defining occurrences of this variable (like in 'var ...'
         * statements or as parameter), as AST nodes.
         * @member {esprima.Identifier[]} Variable#identifiers
         */
        this.identifiers = [];
        /**
         * List of {@link Reference|references} of this variable (excluding parameter entries)
         * in its defining scope and all nested scopes. For defining
         * occurrences only see {@link Variable#defs}.
         * @member {Reference[]} Variable#references
         */
        this.references = [];

        /**
         * List of defining occurrences of this variable (like in 'var ...'
         * statements or as parameter), as custom objects.
         * @typedef {Object} DefEntry
         * @property {String} DefEntry.type - the type of the occurrence (e.g.
         *      "Parameter", "Variable", ...)
         * @property {esprima.Identifier} DefEntry.name - the identifier AST node of the occurrence
         * @property {esprima.Node} DefEntry.node - the enclosing node of the
         *      identifier
         * @property {esprima.Node} [DefEntry.parent] - the enclosing statement
         *      node of the identifier
         * @member {DefEntry[]} Variable#defs
         */
        this.defs = [];

        this.tainted = false;
        /**
         * Whether this is a stack variable.
         * @member {boolean} Variable#stack
         */
        this.stack = true;
        /** 
         * Reference to the enclosing Scope.
         * @member {Scope} Variable#scope 
         */
        this.scope = scope;
    }
179395
public void genStat(JCTree tree, Env<GenContext> env) {
        if (code.isAlive()) {
            code.statBegin(tree.pos);
            genDef(tree, env);
        } else if (env.info.isSwitch && tree.hasTag(VARDEF)) {
            // variables whose declarations are in a switch
            // can be used even if the decl is unreachable.
            code.newLocal(((JCVariableDecl) tree).sym);
        }
    }
757295
@Override
    public void endElement(String uri, String l, String q) {
        /*
         * 1. If current element is a String, update its value from the string buffer.
         * 2. Add the element to parent.
         */
        XDB.Element element = Enum.valueOf(XDB.Element.class, l.toUpperCase());

        switch (element) {
        case M:
            break;

        case P:
            _binder.put(_name, _text.toString());
            break;

        case T:
            break;

        case H:
            _heading = _data.toArray(new String[_data.size()]);
            break;

        case R:
            ++_rindex;
            break;

        case C:
            if (_heading == null) {
                _data.add(_text.toString());
            } else {
                _binder.put(_name + '[' + _rindex + "]." + _heading[_cindex], _text.toString());
                ++_cindex;
            }
            break;
        }
        _text.setLength(0);
    }
949963
function genScript() {

//spilt 'gen new' from 'gen {{COMPONENT NAME}}'
  if (value === 'new') {
// generate a brand new project with the name
//argument 3 is now the project name
    mkdirp(argument3, function (err) {
      if (err) console.error(err)
      else
        process.chdir(argument3),

        //generte dockerfile
        fs.writeFile("Dockerfile", `FROM node:6.5

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY . /usr/src/app

RUN npm set progress=false
RUN npm install

EXPOSE 8080

CMD ["npm", "run", "startContainer"]`, function (err) {
          if (err) {
            return console.log(` ❌  failed to generate due to error:  ${err}`);
          }
          console.log(" 🎁  created: ".cyan + "Dockerfile".white);
        });


        //generte deploy.js
        fs.writeFile("deploy.js", `var request = require('request');

var headers = {
  'Content-Type': 'application/json'
};

var dataString = ''{"docker_tag": '$''{process.env.CIRCLE_BRANCH}"}'';

var options = {
  url: '', // add your docker url aka 'https://registry.hub.docker.com/u/{{the rest of your url}}'
  method: 'POST',
  headers: headers,
  body: dataString
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    console.log(body);
  }
}

request(options, callback);`, function (err) {
          if (err) {
            return console.log(` ❌  failed to generate due to error:  ${err}`);
          }
          console.log(" 🎁  created: ".cyan + "deploy.js".white);
        });

        //generte circle.yml
        fs.writeFile("circle.yml", `machine:
  node:
    version: 6.5

dependencies:
  cache_directories:
    - node_modules
  override:
    - npm prune && npm install

test:
  override:
    - echo 'test needed'

deployment:
  staging:
    branch: [develop, master]
    commands:
      - npm run deploy`, function (err) {
          if (err) {
            return console.log(` ❌  failed to generate due to error:  ${err}`);
          }
          console.log(" 🎁  created: ".cyan + "circle.yml".white);
        });

          //generte .gitignore
          fs.writeFile(".gitignore", `.DS_Store
.tmp
.git
node_modules
.settings
*.log
client/bundle.js
client/bundle.js.map
.idea`, function (err) {
            if (err) {
              return console.log(` ❌  failed to generate due to error:  ${err}`);
            }
            console.log(" 🎁  created: ".cyan + ".gitignore".white);
          });

      //generte webpack.config.js
      fs.writeFile("webpack.config.js", `var path = require('path'),
    webpack = require("webpack"),
    libPath = path.join(__dirname, 'client'),
    wwwPath = path.join(__dirname, 'dist'),
    pkg = require('./package.json'),
    HtmlWebpackPlugin = require('html-webpack-plugin');


const isDev = process.env.NODE_ENV !== 'production';

if (isDev) {
  module.exports = {
    entry: path.join(libPath, '/app/app.module.js'),
    output: {
      path: path.join(wwwPath),
      filename: 'bundle.js'
    },
    module: {
      loaders: [{
        test: /\\.html$/, loader: 'raw'
      }, {
        test: /\\.(png|jpg)$/,
        loader: 'file?name=img/[name].[ext]' // inline base64 URLs for <=10kb images, direct URLs for the rest
      },{
        test: /\\.scss$/,loader: 'style!css!sass'
      }, {
        test: /\\.css$/, loader: 'style!css'
      }, {
        test: /\\.js$/,
        exclude: /(node_modules)/,
        loader: "ng-annotate?add=true!babel"
      }, {
        test: [/fontawesome-webfont\\.svg/, /fontawesome-webfont\\.eot/, /fontawesome-webfont\\.ttf/, /fontawesome-webfont\\.woff/, /fontawesome-webfont\\.woff2/],
        loader: 'file?name=fonts/[name].[ext]'
      },
        { test: /\\.(ttf|otf|eot|svg|woff(2)?)$/, loader: 'url' }]
    },
    plugins: [

      new webpack.ProvidePlugin({
        'window.Masonry': 'Masonry'
      }),

      // HtmlWebpackPlugin: Simplifies creation of HTML files to serve your webpack bundles : https://www.npmjs.com/package/html-webpack-plugin
      new HtmlWebpackPlugin({
        filename: 'index.html',
        pkg: pkg,
        template: path.join(libPath, 'index.ejs'),
        inject: true
      }),

      // OccurenceOrderPlugin: Assign the module and chunk ids by occurrence count. : https://webpack.github.io/docs/list-of-plugins.html#occurenceorderplugin
      new webpack.optimize.OccurenceOrderPlugin(),

      // Deduplication: find duplicate dependencies & prevents duplicate inclusion : https://github.com/webpack/docs/wiki/optimization#deduplication
      new webpack.optimize.DedupePlugin()
    ]
  };
}else{
  module.exports = {
    entry: path.join(libPath, '/app/app.module.js'),
    context: path.resolve(__dirname, './client'),
    output: {
      filename: 'bundle.[hash].js',
      hashDigestLength: 7,
      path: path.join(wwwPath),
      publicPath: '/'
    },
    module: {
      loaders: [{
        test: /\\.html$/, loader: 'raw'
      }, {
        test: /\\.(png|jpg)$/,
        loader: 'file?name=img/[name].[ext]' // inline base64 URLs for <=10kb images, direct URLs for the rest
      },{
        test: /\\.scss$/,loader: 'style!css!sass'
      }, {
        test: /\\.css$/, loader: 'style!css'
      }, {
        test: /\\.js$/,
        exclude: /(node_modules)/,
        loader: "ng-annotate?add=true!babel"
      }, {
        test: [/fontawesome-webfont\\.svg/, /fontawesome-webfont\\.eot/, /fontawesome-webfont\\.ttf/, /fontawesome-webfont\\.woff/, /fontawesome-webfont\\.woff2/],
        loader: 'file?name=fonts/[name].[ext]'
      },
        { test: /\\.(ttf|otf|eot|svg|woff(2)?)$/, loader: 'url' }]
    },
    plugins: [

      new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify('production')
      }),

      new webpack.ProvidePlugin({
        'window.Masonry': 'Masonry'
      }),

      new webpack.optimize.CommonsChunkPlugin('common.js'),
      new webpack.optimize.DedupePlugin(),
      new webpack.optimize.UglifyJsPlugin(),
      new webpack.optimize.AggressiveMergingPlugin(),
      new CompressionPlugin({
        asset: "[path].gz[query]",
        algorithm: "gzip",
        test: /\\.js$|\\.css$|\\.html$/,
        threshold: 10240,
        minRatio: 0.8
      }),

      // HtmlWebpackPlugin: Simplifies creation of HTML files to serve your webpack bundles : https://www.npmjs.com/package/html-webpack-plugin
      new HtmlWebpackPlugin({
        filename: 'index.html',
        pkg: pkg,
        template: path.join(libPath, 'index.ejs'),
        inject: true
      }),

      // OccurenceOrderPlugin: Assign the module and chunk ids by occurrence count. : https://webpack.github.io/docs/list-of-plugins.html#occurenceorderplugin
      new webpack.optimize.OccurenceOrderPlugin(),

      // Deduplication: find duplicate dependencies & prevents duplicate inclusion : https://github.com/webpack/docs/wiki/optimization#deduplication
      new webpack.optimize.DedupePlugin()
    ]
  };
}
`, function (err) {
        if (err) {
          return console.log(` ❌  failed to generate due to error:  ${err}`);
        }
        console.log(" 🎁  created: ".cyan + "karma.conf.js".white);
      });


      //generate package.json
      fs.writeFile("package.json", `{
  "name": "${argument3}",
  "version": "0.0.1",
  "description": "Boilerplate generated by Angular-1.5-cli.",
  "main": "index.js",
  "dependencies": {
    "angular": "1.5.7",
    "angular-animate": "1.5.7",
    "angular-mocks": "1.5.7",
    "angular-ui-router": "0.3.1",
    "bootstrap-css-only": "3.3.6",
    "lodash": "4.13.1",
    "normalize.css": "4.1.1",
    "http-server": "^0.9.0",
    "angular-1.5-cli":"^1.6.0"
  },
  "devDependencies": {
    "angular-mocks": "1.5.7",
    "babel-core": "6.10.4",
    "http-server": "0.9.0",
    "babel-loader": "6.2.4",
    "babel-preset-es2015": "6.9.0",
    "browser-sync": "2.13.0",
    "browser-sync-webpack-plugin": "1.1.4",
    "css-loader": "0.23.1",
    "file-loader": "0.9.0",
    "fs-walk": "0.0.1",
    "gulp": "3.9.1",
    "gulp-rename": "1.2.2",
    "gulp-template": "4.0.0",
    "html-webpack-plugin": "2.28.0",
    "jasmine": "2.4.1",
    "jasmine-core": "2.4.1",
    "karma": "1.1.0",
    "karma-jasmine": "1.0.2",
    "karma-phantomjs-launcher": "1.0.1",
    "karma-sourcemap-loader": "0.3.7",
    "karma-spec-reporter": "0.0.26",
    "karma-webpack": "1.7.0",
    "less": "2.7.1",
    "less-loader": "2.2.3",
    "ng-annotate-loader": "0.1.0",
    "node-libs-browser": "1.0.0",
    "node-sass": "4.4.0",
    "phantomjs-prebuilt": "2.1.7",
    "raw-loader": "0.5.1",
    "run-sequence": "1.2.1",
    "sass-loader": "4.1.1",
    "style-loader": "0.13.1",
    "url-loader": "0.5.7",
    "webpack": "1.13.1",
    "webpack-dev-server": "1.16.3",
    "webpack-stream": "3.2.0",
    "yargs": "4.7.1"
  },
  "scripts": {
    "start": "webpack && webpack-dev-server --content-base client/ --hot --inline",
    "serve": "webpack && webpack-dev-server --content-base client/ --hot --inline",
    "create Component": "gen comp",
    "build": "webpack -p --config ./webpack.config.js --progress",
    "startContainer": "npm run build && http-server ./build",
    "deploy": "node deploy.js"
  },
  "keywords": [
    "angular",
    "webpack",
    "es6"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/SwiftySpartan/Angular-1.5-cli"
  },
  "author": "Andrew Wormald",
  "license": "MIT"
}`, function (err) {
        if (err) {
          return console.log(` ❌  failed to generate due to error:  ${err}`);
        }
        console.log(" 🎁  created: ".cyan + "package.json".white);
      });

      //generate .bablerc
      fs.writeFile(".babelrc", `{
    "presets": [ "es2015"]
  }`, function (err) {
        if (err) {
          return console.log(` ❌  failed to generate due to error:  ${err}`);
        }
        console.log(" 🎁  created: ".cyan + ".bablerc".white);
      });

      // generate client directory
      mkdirp("client", function (err) {
        //within this directory create all the sub scripts (e.g. app.component.html)
        process.chdir("client"),

          mkdirp("assets/img", function (err) {
            console.log(" 🎁  created: ".cyan + "client/assets".white);
            console.log(" 🎁  created: ".cyan + "client/assets/img".white);
          });

        //generate favicon.jpg using base 64
        data = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAeCAYAAABNChwpAAAEDWlDQ1BJQ0MgUHJvZmlsZQAAOI2NVV1oHFUUPrtzZyMkzlNsNIV0qD8NJQ2TVjShtLp/3d02bpZJNtoi6GT27s6Yyc44M7v9oU9FUHwx6psUxL+3gCAo9Q/bPrQvlQol2tQgKD60+INQ6Ium65k7M5lpurHeZe58853vnnvuuWfvBei5qliWkRQBFpquLRcy4nOHj4g9K5CEh6AXBqFXUR0rXalMAjZPC3e1W99Dwntf2dXd/p+tt0YdFSBxH2Kz5qgLiI8B8KdVy3YBevqRHz/qWh72Yui3MUDEL3q44WPXw3M+fo1pZuQs4tOIBVVTaoiXEI/MxfhGDPsxsNZfoE1q66ro5aJim3XdoLFw72H+n23BaIXzbcOnz5mfPoTvYVz7KzUl5+FRxEuqkp9G/Ajia219thzg25abkRE/BpDc3pqvphHvRFys2weqvp+krbWKIX7nhDbzLOItiM8358pTwdirqpPFnMF2xLc1WvLyOwTAibpbmvHHcvttU57y5+XqNZrLe3lE/Pq8eUj2fXKfOe3pfOjzhJYtB/yll5SDFcSDiH+hRkH25+L+sdxKEAMZahrlSX8ukqMOWy/jXW2m6M9LDBc31B9LFuv6gVKg/0Szi3KAr1kGq1GMjU/aLbnq6/lRxc4XfJ98hTargX++DbMJBSiYMIe9Ck1YAxFkKEAG3xbYaKmDDgYyFK0UGYpfoWYXG+fAPPI6tJnNwb7ClP7IyF+D+bjOtCpkhz6CFrIa/I6sFtNl8auFXGMTP34sNwI/JhkgEtmDz14ySfaRcTIBInmKPE32kxyyE2Tv+thKbEVePDfW/byMM1Kmm0XdObS7oGD/MypMXFPXrCwOtoYjyyn7BV29/MZfsVzpLDdRtuIZnbpXzvlf+ev8MvYr/Gqk4H/kV/G3csdazLuyTMPsbFhzd1UabQbjFvDRmcWJxR3zcfHkVw9GfpbJmeev9F08WW8uDkaslwX6avlWGU6NRKz0g/SHtCy9J30o/ca9zX3Kfc19zn3BXQKRO8ud477hLnAfc1/G9mrzGlrfexZ5GLdn6ZZrrEohI2wVHhZywjbhUWEy8icMCGNCUdiBlq3r+xafL549HQ5jH+an+1y+LlYBifuxAvRN/lVVVOlwlCkdVm9NOL5BE4wkQ2SMlDZU97hX86EilU/lUmkQUztTE6mx1EEPh7OmdqBtAvv8HdWpbrJS6tJj3n0CWdM6busNzRV3S9KTYhqvNiqWmuroiKgYhshMjmhTh9ptWhsF7970j/SbMrsPE1suR5z7DMC+P/Hs+y7ijrQAlhyAgccjbhjPygfeBTjzhNqy28EdkUh8C+DU9+z2v/oyeH791OncxHOs5y2AtTc7nb/f73TWPkD/qwBnjX8BoJ98VVBg/m8AAAQASURBVEgN7VddaFxFFP7m5+7mp2lSapqyrYq1xaC7m4ekG5uqaWxFUWhLCoIgKgpSEFF8sH1RY33RB/EHxLwVfREr1p9KQa1Nk4DaWIUQtZbWakM3P5JoN1lbd3fujOdee5eby97dpTVvGbjM3HO+OfOdMzNnZhgCZRiJdgN2N8CuYcB5jfyhbpw8HYBV/XsW8ZaIqH9ectZO9uyCMd9k1YUXW3Fq3jHCPUtfYl3jMNoOGvD3GFgtgzkDmBhH5NgQEm8OANLDVlunZeqF1dEV6VrBt2uDNH0z9Uw8eG20+c9xntrtt8No8KNDSL4dHGgAtywbRvIw6fv9HSq1x3nnE5eit6txsfGRIPacTO25GL3NPis6trs6GngXDXKizxcRfyeHxBDaJgaRSPjl5dqZyObshEy9GoaZkJ0fzFpdU5engN1HwHf7AF2qQw9+ytL8HSTwvaX0QdlpdN4cZbxuQo3sDeq8/3n1z9MNXKxyCdB8N2qYGU9ZqjYwaVofLaV0QZkldKsyutABFII67/8mjKadtkuA3D5JHrZ7ylI17QxDi5Jg1ZTKuN9EaqeC0S4BBb2ftt3DNNfrqzF/tZgDgGjisn/Oto+5BLbix1/Jw2cFBO2ExA4HcLWDhPU/Jzdu2xbZdJ4cFtPq7x0LQkqr/A7KAftImKR4T1HbtyhNM8kEyabCjHvyOsaXJyLL1uaMyXkyp6bOkmxgzi58kVXHezcAuQUEPPAhxOrq0NgsYbkRcuQ0sJM4iIR5ycOF1TFu3ROTtW/M6vxWPyav1OR6/EAJ7grKINr2Ur54rZquv4uOXdnI5gXeh/UrehgGWGz5EoGlCCxFoOQt53Mk62uAVXRGFCNEJ+ZKSkdNXyF+Y6WtWTB6NSUudka29/ixRsnpDTj+s1+2IBMOIL5Fgu8jQHyxUrEzeMZWR7Lq251OKi6SGUTyMcp042GH0f+VCZ3DaDayafIvq2tmlCLtToETVgrFKzbsW+n2c2W5uuhK+cb16rsjdNquvcvqSrfI+k/cObbAH6XLxjuLPbhH7X66nl/QavdyIba4BMj7Vprz7z1AqZoWIcGcW1E1pTLuBnvkYwnGXQJ0GclweoiUM02reg2Dni6H8XQFm/8iGbdOAJYnC9an0LbGkV0mgM+o/VBfmWs5ud5Lt5PDTqdKxdlqOaMvxmTq5TBsg6x5fV7bf7gEujH6EYV37k4k3xoIvICcN4GEOEDx/7QbY2NhBoPyjFJ7VojoU2EPkyZh9WZ0/nGy+19xnmY1aNhPnsZJ+D4tyknSrCNiDxjoD22MPdMDKA9fTe08zYjEc5eMmsxpM0J2ZQ3jnRHOV84W8k9ep0f6iwQ8g4v7OGWasuTX/sfpv6doYNYA/C8WAAAAAElFTkSuQmCC';

        function decodeBase64Image(dataString) {
          var matches = dataString.match(/^data:([A-Za-z-+\/]+);base64,(.+)$/),
            response = {};
          if (matches.length !== 3) {
            return new Error('Invalid input string');
          }
          response.type = matches[1];
          response.data = new Buffer(matches[2], 'base64');
          return response;
        }

        imageBuffer = decodeBase64Image(data);

        fs.writeFile('favicon.ico', imageBuffer.data, function (err) {
          if (err) {
            return console.log(` ❌  failed to generate due to error:  ${err}`);
          }
          console.log(" 🎁  created: ".cyan + "favicon.png".white);
        });

        //generate index.ejs file
        fs.writeFile(`index.ejs`, `<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title><%- htmlWebpackPlugin.options.pkg.title %></title>
</head>
<body ng-app="app" ng-strict-di ng-cloak>
    <app>
        Loading...
    </app>
</body>
<!-- {%= o.htmlWebpackPlugin.options.pkg.name + ' v' + o.htmlWebpackPlugin.options.pkg.version + ' built on ' + new Date() %} -->
</html>`, function (err) {

          if (err) {
            return console.log(` ❌  failed to generate due to error:  ${err}`);
          }
          console.log(" 🎁  created: ".cyan + "index.ejs".white);

        });


        // generate index.html
        fs.writeFile("index.html", `<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Welcome | Angular-1.5-cli</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="description" content="A cli for Angular 1.5">
  <link rel="icon" href="favicon.jpg">
  <base href="/">
</head>
<body ng-app="app" ng-strict-di ng-cloak>

<app>
  Loading...
</app>

<script src="bundle.js"></script>
</body>
</html>`, function (err) {
          if (err) {
            return console.log(` ❌  failed to generate due to error:  ${err}`);
          }
          console.log(" 🎁  created: ".cyan + "index.html".white);
        });

        mkdirp("app/components", function (err) {
          if (err) console.error(err)
          else
            process.chdir("app"),

              //build components.js
              fs.writeFile("components/components.js", `
        import angular from 'angular';

        const ComponentsModule = angular.module('app.components', [

      ]);

      export default ComponentsModule;
`, function (err) {
                if (err) {
                  return console.log(` ❌  failed to generate due to error:  ${err}`);
                }
                console.log(" 🎁  created: ".cyan + "app/components/components.js".white);
              });


          //build component.html
          fs.writeFile(`${scriptName}.component.html`, `<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet">
      <div class="container">
    <img src="https://raw.githubusercontent.com/SwiftySpartan/Angular-1.5-cli/master/canvas1.png" class=".img-responsive center-block">
    <p>Angular-1.5-cli</p>
</div>
<div class="container-fluid main">
  <div class="col-md-1 littleGuy">
    <h1>Welcome</h1>
    <p>
      Welcome to Angular-1.5-cli! We hope you enjoy the CLI that will aid you in effecient web app development.
    </p>
  </div>
  <div class="col-md-1 littleGuy">
    <h1>Commands</h1>
    <p>Generate Project:

gen new {{PROJECT NAME}}<br>
Generates a new project using scss styling <br><br>

gen new {{PROJECT NAME}} --style:css <br>
Generates a new project using css styling <br><br>

gen -c {{COMPONENT NAME}} <br>
Generates a new component using scss styling <br><br>

gen -c {{COMPONENT NAME}} --style:css <br>
Generates a new component using css styling <br><br>
</p>
  </div>
  <div class="col-md-1 littleGuy">
    <h1>Help</h1>
    <p>
      gen h <br>
      gen -h <br>
      gen help <br>
      gen --help <br>
    </p>
  </div>
  <div class="col-md-1 littleGuy">
    <h1>Issues</h1>
    <p>
        Please report any issues on github: <br>
        https://github.com/SwiftySpartan/Angular-1.5-cli/issues
    </p>
  </div>
</div>
`, function (err) {
            if (err) {
              return console.log(` ❌  failed to generate due to error:  ${err}`);
            }
            console.log(" 🎁  created: ".cyan + "client/".white + scriptName.white + ".component.html".white);
          });

          //build scss || css styling scripts
          if (argument3 === "--style:css" || argument4 === "--style:css") {
            // build component.css
            fs.writeFile(scriptName + ".component.css", `

body {
        background-color: #212121;
        color: white;
        font-size: 38px;
}

.container {
  display: block;
  width: 100%;
}

.container p {
  text-align: center;
  font-family: 'Open Sans Condensed', sans-serif;
}


.main{
background-color: #C3002F;
}
.main .littleGuy{
    background-color: #DD0031;
    width: 300px;
    height: 350px;
    position: relative;
    margin-left: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
}

.main .littleGuy h1 {
  font-size: 20px;
  font-family: 'Open Sans Condensed', sans-serif;
}

.main .littleGuy p {
  font-size: 17px;
  font-family: 'Open Sans Condensed', sans-serif;
}
`, function (err) {
              if (err) {
                return console.log(` ❌  failed to generate due to error:  ${err}`);
              }
              console.log(" 🎁  created: ".cyan + "client/".white + scriptName.white + ".component.css".white);
            });
          } else {
            // build component.scss
            fs.writeFile(scriptName + ".component.scss", `@import url('https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300');
@import url('https://fonts.googleapis.com/css?family=Titillium+Web:700');

body {
        background-color: #212121;
        color: white;
        font-size: 38px;
      }

.container {
  display: block;
  width: 100%;
  p {
    text-align: center;
    font-family: 'Open Sans Condensed', sans-serif;
  }
}
.main{
background-color: #C3002F;

  .littleGuy{
    background-color: #DD0031;
    width: 300px;
    height: 350px;
    position: relative;
    margin-left: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
    h1 {
      font-size: 20px;
      font-family: 'Open Sans Condensed', sans-serif;

    }

    p {
      font-size: 17px;
      font-family: 'Open Sans Condensed', sans-serif;
    }
  }
}
`, function (err) {
              if (err) {
                return console.log(` ❌  failed to generate due to error:  ${err}`);
              }
              console.log(" 🎁  created: ".cyan + "client/".white + scriptName.white + ".component.scss".white);
            });
          }


          //build component.js
          if (argument3 === "--style:css" || argument4 === "--style:css") {
            // build component.js with import of css folder
            fs.writeFile(scriptName + ".component.js", `import template from './app.component.html';
import './app.component.scss';

const AppComponent = {
  template
};

export default AppComponent;`, function (err) {
              if (err) {
                return console.log(` ❌  failed to generate due to error:  ${err}`);
              }
              console.log(" 🎁  created: ".cyan + "client/".white + scriptName.white + ".component.js".white);
            });
          } else {
            // build component.js with import of scss folder
            fs.writeFile(scriptName + ".component.js", `import template from './app.component.html';
import './app.component.scss';

const AppComponent = {
  template
};

export default AppComponent;`, function (err) {
              if (err) {
                return console.log(` ❌  failed to generate due to error:  ${err}`);
              }
              console.log(" 🎁  created: ".cyan + "client/".white + scriptName.white + ".component.js".white);
            });
          }

          //build module.js
          fs.writeFile(scriptName + ".module.js", `import 'bootstrap-css-only';
import 'normalize.css';
import angular from 'angular';
import appComponent from './app.component';
import ComponentsModule from './components/components';

angular.module('app', [
  ComponentsModule.name
]).component('app', appComponent);`, function (err) {
            if (err) {
              return console.log(` ❌  failed to generate due to error:  ${err}`);
            }
            console.log(" 🎁  created: ".cyan + "client/".white + scriptName.white + ".module.js".white);
          });

        });

      });
      //making client directory and sub scripts should be last in the list as then you do not need to go back up a level in the directory ladder
    });
//argument 4 is now the styling order


  } else if (value === '-c') {

    //go to components directory
    const rootBase = __dirname

    process.chdir(`./client/app/components`);
    // GEN COMPONENT SCRIPT
    componentsArray = [];
    genArr = [];


    function camelize(str) {
      return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter, index) {
        return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
      }).replace(/\s+/g, '');
    }

    value = camelize(`${value}`)
    argument3 = camelize(`${argument3}`)
    argument4 = camelize(`${argument4}`)

    // sync app.component with updates
    fs.readdir(process.cwd(), function (err, items) {
      genArr = items;
      generateDirectArray(genArr);
    });


    function generateDirectArray(items) {
      for (var i = 0; i < items.length; i++) {
        if (isDirectory(items[i])) {
        } else {
          componentsArray.push(items[i]);
        }
      }
      importStringGenerator();
    }

    function isDirectory(inputString) {
      var str = inputString;
      var patt = new RegExp("[.]");
      var res = patt.test(str);
      return res;
    }

    String.prototype.capitalizeFirstLetter = function () {
      return this.charAt(0).toUpperCase() + this.slice(1);
    }

    function importStringGenerator() {
      componentsArray.push(`${argument3}`);
      genString = "";
      for (var i = 0; i < componentsArray.length; i++) {
        genString = genString + `    import ${componentsArray[i].capitalizeFirstLetter()}Module from './${componentsArray[i]}/${componentsArray[i]}.module';\r`
      }
      listString = "";
      for (var i = 0; i < componentsArray.length; i++) {

        // check if last in list in order to not include comma
        if (i === (componentsArray.length - 1)) {
          listString = listString + `     ${componentsArray[i].capitalizeFirstLetter()}Module` + `.name \r`
        } else {
          listString = listString + `     ${componentsArray[i].capitalizeFirstLetter()}Module` + '.name, \r'
        }

      }


      fs.writeFile("components.js", `import angular from 'angular';
${genString}

const ComponentsModule = angular.module('app.components',[
  ${listString}
]);

export default ComponentsModule;`, function (err) {
        if (err) {
          return console.log(` ❌  failed to update due to error:  ${err}`);
        }
        console.log(" 🔰  updated: ".cyan + "components.js".white);
      });
    }


    mkdirp(argument3, function (err) {
      console.log("Generating Component...".white)
      if (err) console.error(err)
      else
        process.chdir(argument3),

          //build component.html
          fs.writeFile(argument3 + ".component.html", `<h1> ${argument3} works! </h1>`, function (err) {
            if (err) {
              return console.log(` ❌  failed to generate due to error:  ${err}`);
            }
            console.log(" 🎁  created: ".cyan + argument3.white + ".component.html".white);
          });

      //build scss || css styling scripts
      if (argument3 === "--style:css" || argument4 === "--style:css") {
        // build component.css
        fs.writeFile(argument3 + ".component.css", "", function (err) {
          if (err) {
            return console.log(` ❌  failed to generate due to error:  ${err}`);
          }
          console.log(" 🎁  created: ".cyan + argument3.white + ".component.css".white);
        });
      } else {
        // build component.scss
        fs.writeFile(argument3 + ".component.scss", "", function (err) {
          if (err) {
            return console.log(` ❌  failed to generate due to error:  ${err}`);
          }
          console.log(" 🎁  created: ".cyan + argument3.white + ".component.scss".white);
        });
      }

if (argument3 === "--style:css" || argument4 === "--style:css") {
  // include component.css
  fs.writeFile(argument3 + ".component.js", `import template from './${argument3}.component.html';
import controller from './${argument3}.controller.js';
import './${argument3}.component.css';

let ${argument3}Component = {
  restrict: 'E',
  bindings: {},
  template,
  controller,
  controllerAs: '${argument3}Controller'
};
export default ${argument3}Component;`, function (err) {
    if (err) {
      return console.log(` ❌  failed to generate due to error:  ${err}`);
    }
    console.log(" 🎁  created: ".cyan + argument3.white + ".component.js".white);
  });
} else {
  // include component.scss
  fs.writeFile(argument3 + ".component.js", `import template from './${argument3}.component.html';
import controller from './${argument3}.controller.js';
import './${argument3}.component.scss';

let ${argument3}Component = {
  restrict: 'E',
  bindings: {},
  template,
  controller,
  controllerAs: '${argument3}Controller'
};
export default ${argument3}Component;`, function (err) {
    if (err) {
      return console.log(` ❌  failed to generate due to error:  ${err}`);
    }
    console.log(" 🎁  created: ".cyan + argument3.white + ".component.js".white);
  });
}



      //build module.js
      fs.writeFile(argument3 + ".module.js", `import angular from 'angular';
import ${argument3}Component from './${argument3}.component';

const ${argument3}Module = angular.module('${argument3}', [])
  .component('${argument3}', ${argument3}Component);
export default ${argument3}Module;`, function (err) {
        if (err) {
          return console.log(` ❌  failed to generate due to error:  ${err}`);
        }
        console.log(" 🎁  created: ".cyan + argument3.white + ".module.js".white);
      });

      //build controller.js
      fs.writeFile(argument3 + ".controller.js", `class ${argument3}Controller {
    constructor() {
      this.name = '${argument3}';
    }
  }

  export default ${argument3}Controller;`, function (err) {
        if (err) {
          return console.log(` ❌  failed to generate due to error:  ${err}`);
        }
        console.log(" 🎁  created: ".cyan + argument3.white + ".controller.js".white);
      });
    });


  } else if (value === 'help' || value === '-help' || value === '--help' || value === '-h') {
    // provide user with help
    console.log(`
    - gen new {{PROJECT NAME}}

    - gen new {{PROJECT NAME}} --style:css
        The default styling is set to SCSS.

    - gen -c {{COMPONENT NAME}} --style:css
        The default styling is set to SCSS.

    - gen -c {{COMPONENT NAME}}

    - gen v
    - gen -v
    - gen version
    - gen --version
        This reveals the current version number

    - gen h
    - gen -h
    - gen help
    - gen --version
        This reveals the Angular-1.5-cli command list
    `);
  } else if (value === 'v' || value === 'version' || value === '-v' || value === '--version') {
    //provide user with version number
    console.log(packagejson.version);
  } else if (value === "serve" || value === "comp") {
    if (value === "serve") {
      console.log('serving angular 1.5 app...');
      cmd.get(
        `
                webpack && webpack-dev-server --content-base client/
            `,
        function (data) {

        }
      );

    } else if (value === "comp") {

      // user chose component
      prompt.start();

      prompt.get([{
        name: 'name',
        required: true
      }], function (err, result) {
        //
        // Log the results.
        //
        var projectName = result.name
        console.log(`Would you like to use 'scss or css'?`);
        prompt.get([{
          name: 'styling',
          required: true
        }], function (err, result) {
          //
          // Log the results.
          //
          var stylingVar = '';
          if (result.styling === 'css') {
            stylingVar = '--style:css'
          } else {
            stylingVar = '--style:scss'
          }
          console.log(`Generating component: ${projectName}`);

          value = '-c';
          argument3 = projectName;
          argument4 = stylingVar;

          //
          //re-execute genScript with new values
          genScript();
          //
          //

        });

      });
    }
  } else if (value === 'copyTo' || value === 'transferTo') {

    fs.copy(`${argument3}`, `${argument4}`, function (err) {
      if (err) return console.error(err)
        console.log('Success:'.green + ' created:'.white + './dist/assets')
    });

  }else if (value === '-r' || value === 'remove') {

    function camelize(str) {
      return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter, index) {
        return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
      }).replace(/\s+/g, '');
    }

    value = camelize(`${value}`)
    argument3 = camelize(`${argument3}`)
    argument4 = camelize(`${argument4}`)

    function camelize(str) {
      return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter, index) {
        return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
      }).replace(/\s+/g, '');
    }

    // value = camelize(`${value}`)
    argument3 = camelize(`${argument3}`)
    argument4 = camelize(`${argument4}`)

    console.log('Delete Component');
    prompt.start();
    console.log(`Are you sure you would like to delete ${argument3}`.red);
    prompt.get([{
      name: 'Answer',
      required: true
    }], function (err, result) {
      if (err) {
        return console.log(err)
      }

      if (result.Answer === 'yes') {
        //

        process.chdir(`./client/app/components`);
        fs.remove(`./${argument3}`, err => {
          if (err) return console.error(err)

          console.log(`Deleted ${colors.red.strikethrough(`${argument3}`)}`)

        //updateComponentsJS after it has deleted the component
        updateComponentsJS()
      })

      } else if (result.Answer === 'no' || result.Answer === 'exit' || result.Answer === 'stop') {

      } else {
        console.log('Exiting...'.orange)
      }


    });

  } else if (value === 'clone') {

    process.chdir(`./client/app/components`);

    function camelize(str) {
      return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter, index) {
        return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
      }).replace(/\s+/g, '');
    }

    value = camelize(`${value}`)
    argument3 = camelize(`${argument3}`)
    argument4 = camelize(`${argument4}`)

    //updateComponentsJS with new directory name
    updateComponentsJS(argument4);

    fs.copy(`${argument3}`, `${argument4}`, function (err) {
      if (err) return console.error(err)

      console.log("Transfer complete!")

      console.log("Renaming folders...")
      process.chdir(`./${argument4}`);
      renameComponentFiles();
    });

  }else if (value === '-s' || value === 'service') {
    process.chdir(`./client/app`);

    function camelize(str) {
      return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function (letter, index) {
        return index == 0 ? letter.toLowerCase() : letter.toUpperCase();
      }).replace(/\s+/g, '');
    }

    tempValue = 'noName';

    if (argument3 === '--post' || argument3 === '--get'){
      tempValue = argument3
      argument3 = argument4
      argument4 = tempValue
    }

    argument3 = camelize(`${argument3}`)


    // check if services directory. If there is none then create one and move to it

fs.stat('services', function(err, stat) {
  if(err == null) {
      // FILE EXISTS
      process.chdir('services');



      if (argument4 === '--get') {
        //create a GET service

        mkdirp(`${argument3}`, function (err) {
          process.chdir(`${argument3}`);
          fs.writeFile(`${argument3}.js`, `class ${argument3}Service {
  constructor($http, $q) {
    ngInject';

    //INIT DEPENDENCIES
    this.$http = $http;
    this.$q = $q;
  }

  getData() {
    const defer = this.$q.defer();
    this.$http.get('https://angular-1-5-cli.firebaseio.com/data.json')
      .then((response) => {
      const data = response.data;
    defer.resolve(data);
  })
  .catch((response) => {
      defer.reject(response.statusText);
  });
    return defer.promise;
  }
}

export default ${argument3}Service;`, function (err) {
            if (err) {
              return console.log(` ❌  failed to generate due to error:  ${err}`);
            }
            console.log(" 🎁  created: ".cyan + `${argument3}.js`.white);
            // Re-Create Services.js
            // 1. get list of all services
            // 2. write them into the services
            updateServicesJS(argument3)
          });
        });


      } else if (argument4 === '--post') {
        //create a POST service
        mkdirp(`${argument3}`, function (err) {
          process.chdir(argument3)

          fs.writeFile(`${argument3}.js`, `class ${argument3}Service {
  constructor($http, $q) {
    'ngInject';

    //INIT DEPENDENCIES
    this.$http = $http;
    this.$q = $q;
  }

  getData(data) {
    const defer = this.$q.defer();
    this.$http.post('http://httpbin.org/post', data)
      .then((response) => {
      const data = response.data;
    defer.resolve(data);
  })
  .catch((response) => {
      defer.reject(response.statusText);
  });
    return defer.promise;
  }
}

export default ${argument3}Service;`, function (err) {
            if (err) {
              return console.log(` ❌  failed to generate due to error:  ${err}`);
            }
            console.log(" 🎁  created: ".cyan + `${argument3}.js`.white);
            // Re-Create Services.js
            // 1. get list of all services
            // 2. write them into the services
            updateServicesJS(argument3)
          });
        });
      } else {
        // no type specified
        mkdirp(`${argument3}`, function (err) {
          process.chdir(argument3)

          fs.writeFile(`${argument3}.js`, `class ${argument3}Service {
  constructor() {
    'ngInject';

  }
}

export default ${argument3}Service;`, function (err) {
            if (err) {
              return console.log(` ❌  failed to generate due to error:  ${err}`);
            }
            console.log(" 🎁  created: ".cyan + `${argument3}.js`.white);
            // Re-Create Services.js
            // 1. get list of all services
            // 2. write them into the services
            updateServicesJS(argument3)
          });
        });

      }


  } else if(err.code == 'ENOENT') {
      // FILE DOES NOT EXIST
      mkdirp("services", function (err) {
        console.log(" 🎁  created: ".cyan + "services/config".white);
        process.chdir('services');

        if (argument4 === '--get') {
          //create a GET service

          mkdirp(`${argument3}`, function (err) {
            process.chdir(`${argument3}`);
            fs.writeFile(`${argument3}.js`, `class ${argument3}Service {
  constructor($http, $q) {
    'ngInject';

    //INIT DEPENDENCIES
    this.$http = $http;
    this.$q = $q;
  }

  getData() {
    const defer = this.$q.defer();
    this.$http.get('https://angular-1-5-cli.firebaseio.com/data.json')
      .then((response) => {
      const data = response.data;
    defer.resolve(data);
  })
  .catch((response) => {
      defer.reject(response.statusText);
  });
    return defer.promise;
  }
}

export default ${argument3}Service;`, function (err) {
              if (err) {
                return console.log(` ❌  failed to generate due to error:  ${err}`);
              }
              console.log(" 🎁  created: ".cyan + `${argument3}.js`.white);
              // Re-Create Services.js
              // 1. get list of all services
              // 2. write them into the services

              updateServicesJS(argument3)
            });
          });


        } else if (argument4 === '--post') {
          //create a POST service
          mkdirp(`${argument3}`, function (err) {
            process.chdir(argument3)

            fs.writeFile(`${argument3}.js`, `class ${argument3}Service {
  constructor($http, $q) {
    'ngInject';

    //INIT DEPENDENCIES
    this.$http = $http;
    this.$q = $q;
  }

  getData(data) {
    const defer = this.$q.defer();
    this.$http.post('http://httpbin.org/post', data)
      .then((response) => {
      const data = response.data;
    defer.resolve(data);
  })
  .catch((response) => {
      defer.reject(response.statusText);
  });
    return defer.promise;
  }
}

export default ${argument3}Service;`, function (err) {
              if (err) {
                return console.log(` ❌  failed to generate due to error:  ${err}`);
              }
              console.log(" 🎁  created: ".cyan + `${argument3}.js`.white);

              // Re-Create Services.js
              // 1. get list of all services
              // 2. write them into the services

              updateServicesJS(argument3)
            });
          });
        } else {
          // no type specified
          mkdirp(`${argument3}`, function (err) {
            process.chdir(argument3)

            fs.writeFile(`${argument3}.js`, `class ${argument3}Service {
  constructor() {
    'ngInject';

  }
}

export default ${argument3}Service;`, function (err) {
              if (err) {
                return console.log(` ❌  failed to generate due to error:  ${err}`);
              }
              console.log(" 🎁  created: ".cyan + `${argument3}.js`.white);
              // Re-Create Services.js
              // 1. get list of all services
              // 2. write them into the services

              updateServicesJS(argument3)
            });
          });

        }



        });

  } else {
      console.log('Error: ', err.code);
  }
});






    // take name given and typ and create service (POST or GET request)





  }else if (value === 'update' && argument3 === 'components.js') {
    updateComponentsJS()
  } else {
    //promt user to find out what they want to generate
    console.log(`You can always type 'gen new {{PROJECT NAME}} for a new project or 'gen -c {{COMPONENT NAME}}'`.white);
    prompt.start();

    console.log(`Would you like to generate a 'project' or 'component' ?`.red);
    prompt.get([{
      name: 'type',
      required: true
    }], function (err, result) {
      //
      // Log the results.
      //
      if (result.type === `project` || result.type === `Project`) {
        // user chose project
        prompt.start();

        prompt.get([{
          name: 'name',
          required: true
        }], function (err, result) {
          //
          // Log the results.
          //
          var projectName = result.name
          console.log(`Would you like to use 'scss or css'?`);
          prompt.get([{
            name: 'styling',
            required: true
          }], function (err, result) {
            //
            // Log the results.
            //
            var stylingVar = '';
            if (result.styling === 'css') {
              stylingVar = '--style:css'
            } else {
              stylingVar = '--style:scss'
            }
            console.log(`Generating project: ${projectName}`);

            value = 'new';
            argument3 = projectName;
            argument4 = stylingVar;


            //
            //re-execute genScript with new values
            genScript();
            //
            //

          });
        });
      } else if (result.type === `component` || result.type === `Component`) {
        // user chose component
        prompt.start();

        prompt.get([{
          name: 'name',
          required: true
        }], function (err, result) {
          //
          // Log the results.
          //
          var projectName = result.name
          console.log(`Would you like to use 'scss or css'?`);
          prompt.get([{
            name: 'styling',
            required: true
          }], function (err, result) {
            //
            // Log the results.
            //
            var stylingVar = '';
            if (result.styling === 'css') {
              stylingVar = '--style:css'
            } else {
              stylingVar = '--style:scss'
            }
            console.log(`Generating component: ${projectName}`);

            value = '-c';
            argument3 = projectName;
            argument4 = stylingVar;

            //
            //re-execute genScript with new values
            genScript();
            //
            //

          });

        });
      } else {
        console.log(`Please try again. Unfortunately I do not understand what you would like me to do for you...`.red);
      }
    });
  }
//end of genScript
}
81300
private void variable( HashMap<String, Expression> variables, FormattableContainer currentRule ) {
        StringBuilder builder = cachesBuilder;
        builder.append( '@' );
        char ch;
        LOOP: for( ;; ) {
            ch = read();
            switch( ch ) {
                case ':':
                    if( !isVariableName(builder) ) {
                        builder.append( ch );
                        continue;
                    }
                    break LOOP;
                case ';':
                    String name = trim( builder );
                    if( name.startsWith( "@import " ) ) {
                        importFile( currentRule, name.substring( 8 ).trim() );
                        return;
                    }
                    if( name.endsWith( "()" ) ) {
                        currentRule.add( new VariableExpression( reader, name.substring( 0, name.length() - 2 ) ) ); // reference to detached ruleset
                    } else {
                        currentRule.add( new CssAtRule( reader, name + ';') ); // directives like @charset "UTF-8";
                    }
                    return;
//                    throw createException( "Unrecognized input: '" + name + "'" );
                default:
                    builder.append( ch );
            }
        }
        String name = trim( builder );
        Expression value = parseExpression( (char)0 );
        ch = read();
        if( ch == '}' ) {
            back( ch );
        } else {
            if( ch != ';' ) {
                throw createException( "Unrecognized input: '" + ch + "'" );
            }
        }
        variables.put( name, value );
    }
1271153
private void _addActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__addActionPerformed
        JFileChooser fc = new JFileChooser();
        fc.setMultiSelectionEnabled(true);
        fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fc.setFileFilter(new FileFilter() {

            @Override
            public boolean accept(File f) {
                return f.isDirectory() || f.getName().endsWith(".R") || f.getName().endsWith(".Rdata");
            }

            @Override
            public String getDescription() {
                return "R object file";
            }
        });
        if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION && fc.getSelectedFiles() != null) {
            File[] files = fc.getSelectedFiles();
            for (File file : files) {
                if (file.getName().endsWith(".R")) {
                    if (R != null) {
                        R.source(file);
                    }
                } else if (file.getName().endsWith(".Rdata")) {
                    if (R != null) {
                        R.load(file);
                    }
                } else {
                    Log.Out.println("Not loading/sourcing " + file.getName());
                }
            }
        }
        update();
    }
1352624
public void endElement(String uri, String name, String qName)
    {
        boolean isDebug = logger.isDebugEnabled();
        try
        {
            switch (getLiteralId(qName))
            {
                case MAPPING_REPOSITORY:
                    {
                        currentAttributeContainer = null;
                        break;
                    }
                case CLASS_DESCRIPTOR:
                    {
                        currentAttributeContainer = null;
                        break;
                    }
                case JDBC_CONNECTION_DESCRIPTOR:
                    {
                        logger.debug("   < " + tags.getTagById(JDBC_CONNECTION_DESCRIPTOR));
                        m_CurrentJCD = null;
                        currentAttributeContainer = null;
                        break;
                    }
                case CONNECTION_POOL:
                    {
                        logger.debug("   < " + tags.getTagById(CONNECTION_POOL));
                        currentAttributeContainer = m_CurrentJCD;
                        break;
                    }
                case SEQUENCE_MANAGER:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(SEQUENCE_MANAGER));
                        // set to null at the end of the tag!!
                        this.currentSequenceDescriptor = null;
                        currentAttributeContainer = m_CurrentJCD;
                        break;
                    }
                case OBJECT_CACHE:
                    {
                        if(currentAttributeContainer != null)
                        {
                            if (isDebug) logger.debug("    < " + tags.getTagById(OBJECT_CACHE));
                            // set to null or previous element level at the end of the tag!!
                            currentAttributeContainer = m_CurrentJCD;
                        }
                        break;
                    }
                case ATTRIBUTE:
                    {
                        if(currentAttributeContainer != null)
                        {
                            if (isDebug) logger.debug("      < " + tags.getTagById(ATTRIBUTE));
                        }
                        break;
                    }
                default :
                    {
                        // noop
                    }
            }
        }
        catch (Exception ex)
        {
            logger.error(ex);
            throw new PersistenceBrokerException(ex);
        }
    }