Example usage for java.awt Font BOLD

List of usage examples for java.awt Font BOLD

Introduction

In this page you can find the example usage for java.awt Font BOLD.

Prototype

int BOLD

To view the source code for java.awt Font BOLD.

Click Source Link

Document

The bold style constant.

Usage

From source file:SIFT_Volume_Stitching.java

/**
* Main method of the plugin//from  w w w.java 2s. c  om
* @param args unused
*/
final public void run(final String args) {
    fsf.clear();
    fsb.clear();

    if (IJ.versionLessThan("1.41n"))
        return;

    /* Estimated Overlap size */
    int ov = 100;

    /* Estimated start and end of overlap */
    int startSlice = 100;
    int endSlice = 200;

    /* Image Choice Dialog Box */
    Font myfont = new Font("SansSerif", Font.BOLD, 12);
    final int[] ids = WindowManager.getIDList();
    if (ids == null || ids.length < 2) {
        IJ.showMessage("You should have at least two images open.");
        return;
    }

    final String[] titles = new String[ids.length];
    final int[] sSizes = new int[ids.length];
    for (int i = 0; i < ids.length; ++i) {
        titles[i] = (WindowManager.getImage(ids[i])).getTitle();
        sSizes[i] = (WindowManager.getImage(ids[i])).getStackSize();
    }

    final GenericDialog gd = new GenericDialog("2D-SIFT in 3D-Space Volume Stitching");
    final GenericDialog gdChannels = new GenericDialog("Additional Channels");
    final GenericDialog gdFiltered = new GenericDialog("Filtered Images");

    gd.addMessage("* Image Selection", myfont);
    final String current = WindowManager.getCurrentImage().getTitle();
    gd.addChoice("Front_Image", titles, current);
    gd.addChoice("Back_Image", titles, current.equals(titles[0]) ? titles[1] : titles[0]);
    gd.addChoice("Stitching Orientation", stitchingModelStrings, stitchingMethod);

    gd.addMessage("* Overlap Detection Method", myfont);
    gd.addChoice("Method Selection", OVMethod, myOVMethod);
    WindowManager.getCurrentImage().getStackSize();
    gd.addNumericField("Split (Block-by-Block)", 5, 0, 0, "");
    gd.addNumericField("Overlap Size (Slice-by-Slice)", 200, 0, 0, "");
    gd.addNumericField("Start of Overlap (Determined)", startSlice, 0, 0, "");
    gd.addNumericField("End of Overlap (Determined)", endSlice, 0, 0, "");

    boolean cAll = false;
    gd.addMessage("* Additional Channels", myfont);
    gd.addCheckbox("More channels?", cAll);

    int it = 2;
    int MIP = 50;
    gd.addMessage("* 3D Registration Parameters", myfont);
    gd.addCheckbox("3D Registration", Reg3D);
    gd.addNumericField("Number_Of_Iterations", it, 0, 0, "");
    gd.addNumericField("MIP size", MIP, 0, 0, "Slices");

    float minSize = 3.5f;
    float maxSize = 14.5f;
    gd.addMessage("* SIFT Parameters", myfont);
    gd.addNumericField("Minimum Size of Structure :", minSize, 1, 0, "pixels");
    gd.addNumericField("Maximum Size of Structure :", maxSize, 1, 0, "pixels");

    gd.addMessage("* Filtered Image Selection", myfont);
    gd.addCheckbox("Compare Filtered Images?", template_bool);

    gd.addMessage("* Fusion Method", myfont);
    gd.addChoice("Method", methodListCollection, fusionMethod);

    /* ----- Window Channels -----*/
    boolean c2 = false;
    boolean c3 = false;
    gdChannels.addCheckbox("Channel 2", c2);
    gdChannels.addChoice("Channel_2_Front_Image", titles, current);
    gdChannels.addChoice("Channel_2_Back_Image", titles, current.equals(titles[0]) ? titles[1] : titles[0]);
    gdChannels.addCheckbox("Channel 3", c3);
    gdChannels.addChoice("Channel_3_Front_Image", titles, current);
    gdChannels.addChoice("Channel_3_Back_Image", titles, current.equals(titles[0]) ? titles[1] : titles[0]);
    /* ----- -------------- -----*/

    /* ------ Win Filtered ------*/
    gdFiltered.addChoice("Front_Filtered_Image", titles, current);
    gdFiltered.addChoice("Back_Filtered_Image", titles, current.equals(titles[0]) ? titles[1] : titles[0]);
    /* ----- -------------- -----*/

    gd.showDialog();
    if (gd.wasCanceled())
        return;

    /* Variables */

    long start_time = System.currentTimeMillis();

    firstImage = WindowManager.getImage(ids[gd.getNextChoiceIndex()]);
    secondImage = WindowManager.getImage(ids[gd.getNextChoiceIndex()]);

    ImagePlus impf = new ImagePlus(firstImage.getTitle(), firstImage.getStack());
    impf.setCalibration(firstImage.getCalibration());
    ImagePlus impb = new ImagePlus(secondImage.getTitle(), secondImage.getStack());
    impb.setCalibration(secondImage.getCalibration());

    if (impf.getCalibration().pixelWidth != impb.getCalibration().pixelWidth
            && impf.getCalibration().pixelHeight != impb.getCalibration().pixelHeight
            && impf.getCalibration().pixelDepth != impb.getCalibration().pixelDepth
            && impf.getCalibration().getUnit() == impb.getCalibration().getUnit()) {
        IJ.log("Calibration is different");
        return;
    }

    Calibration copyCalibration = new Calibration();
    copyCalibration = impf.getCalibration().copy();

    stitchingMethod = stitchingModelStrings[gd.getNextChoiceIndex()];

    if (stitchingMethod != "Front - Back") {

        impf = stackOrientation(impf, stitchingMethod);
        impb = stackOrientation(impb, stitchingMethod);
    }

    myOVMethod = OVMethod[gd.getNextChoiceIndex()];
    int split = (int) gd.getNextNumber();
    ov = (int) gd.getNextNumber();
    startSlice = (int) gd.getNextNumber();
    endSlice = (int) gd.getNextNumber();

    int indb = impb.getStackSize();

    cAll = gd.getNextBoolean();

    Reg3D = gd.getNextBoolean();
    it = (int) gd.getNextNumber();
    MIP = (int) gd.getNextNumber();

    minSize = (float) gd.getNextNumber();
    maxSize = (float) gd.getNextNumber();

    template_bool = gd.getNextBoolean();
    fusionMethod = gd.getNextChoice();

    /* ------- SIFT parameters ------- */

    /*------------------------*/
    IJ.log("Structures sizes, min:" + minSize + ", max:" + maxSize);
    int[] ImgSizef = impf.getDimensions();
    int[] ImgSizeb = impb.getDimensions();
    int[] AllSizes = ArrayUtils.addAll(Arrays.copyOfRange(ImgSizef, 0, 2), Arrays.copyOfRange(ImgSizeb, 0, 2));
    int minOSize = AllSizes[0];
    //IJ.log("Taille: "+AllSizes.length+"  Contenu:"+AllSizes[0]+AllSizes[1]+AllSizes[2]+AllSizes[3]);
    for (int i = 1; i < AllSizes.length; i++) {
        if (AllSizes[i] < minOSize) {
            minOSize = AllSizes[i];
        }
    }
    /*------------------------*/

    p.sift.initialSigma = (float) (minSize / (2 * Math.sqrt(2)));
    p.sift.steps = (int) ((maxSize / minSize) + 1);
    p.sift.minOctaveSize = 64;
    p.sift.maxOctaveSize = (int) minOSize;

    IJ.log("Sift parameters, initial sigma:" + p.sift.initialSigma + "\n steps:" + p.sift.steps
            + " \n MinOctaveSize:" + p.sift.minOctaveSize + " \n MaxOctaveSize:" + p.sift.maxOctaveSize);

    /* Computations */

    bTemplate = null;
    fTemplate = null;
    /* If use of a template exchange between template and real channel */
    fTemplate = new ImagePlus(impf.getTitle(), impf.getStack());
    bTemplate = new ImagePlus(impb.getTitle(), impb.getStack());

    channel2f = null;
    channel2b = null;
    channel3f = null;
    channel3b = null;
    channel2f = null;
    channel2b = null;
    channel3f = null;
    channel3b = null;

    if (cAll == true && template_bool == true) {
        gdChannels.showDialog();
        gd.setVisible(false);

        /* Variables */
        c2 = gdChannels.getNextBoolean();
        channel2f = WindowManager.getImage(ids[gdChannels.getNextChoiceIndex()]);
        channel2b = WindowManager.getImage(ids[gdChannels.getNextChoiceIndex()]);

        c3 = gdChannels.getNextBoolean();
        channel3f = WindowManager.getImage(ids[gdChannels.getNextChoiceIndex()]);
        channel3b = WindowManager.getImage(ids[gdChannels.getNextChoiceIndex()]);

        if ((gdChannels.wasOKed())) {
            gdFiltered.showDialog();

            /* Variables */

            firstImage = WindowManager.getImage(ids[gdFiltered.getNextChoiceIndex()]);
            secondImage = WindowManager.getImage(ids[gdFiltered.getNextChoiceIndex()]);

            if (gdFiltered.wasOKed())
                gd.setVisible(true);
        }
    } else if (cAll == false && template_bool == true) {
        gdFiltered.showDialog();
        gd.setVisible(false);

        /* Variables */

        firstImage = WindowManager.getImage(ids[gdFiltered.getNextChoiceIndex()]);
        secondImage = WindowManager.getImage(ids[gdFiltered.getNextChoiceIndex()]);

        if (gdFiltered.wasOKed()) {
            gd.setVisible(true);
        }
    } else if (cAll == true && template_bool == false) {
        gdChannels.showDialog();
        gd.setVisible(false);

        /* Variables */
        c2 = gdChannels.getNextBoolean();
        channel2f = WindowManager.getImage(ids[gdChannels.getNextChoiceIndex()]);
        channel2b = WindowManager.getImage(ids[gdChannels.getNextChoiceIndex()]);
        c3 = gdChannels.getNextBoolean();
        channel3f = WindowManager.getImage(ids[gdChannels.getNextChoiceIndex()]);
        channel3b = WindowManager.getImage(ids[gdChannels.getNextChoiceIndex()]);

        if (gdChannels.wasOKed()) {
            gd.setVisible(true);
        }
    }

    if (template_bool == true) {
        impf = new ImagePlus(firstImage.getTitle(), firstImage.getStack());
        impf.setCalibration(firstImage.getCalibration());
        impb = new ImagePlus(secondImage.getTitle(), secondImage.getStack());
        impb.setCalibration(secondImage.getCalibration());

    }

    if (cAll == true) {
        channel2front = new ImagePlus(channel2f.getTitle(), channel2f.getStack());
        channel2front.setCalibration(channel2f.getCalibration());
        channel2back = new ImagePlus(channel2b.getTitle(), channel2b.getStack());
        channel2back.setCalibration(channel2b.getCalibration());

        channel3front = new ImagePlus(channel3f.getTitle(), channel3f.getStack());
        channel3front.setCalibration(channel3f.getCalibration());
        channel3back = new ImagePlus(channel3b.getTitle(), channel3b.getStack());
        channel3back.setCalibration(channel3b.getCalibration());
        if (stitchingMethod != "Front - Back") {
            channel2front = stackOrientation(channel2f, stitchingMethod);
            channel2back = stackOrientation(channel2b, stitchingMethod);
            channel3front = stackOrientation(channel3f, stitchingMethod);
            channel3back = stackOrientation(channel3b, stitchingMethod);
        }
        if (myOVMethod == "Determined") {
            tempimpf = channel2front.getStack();
            new_impf = tempimpf.crop(0, 0, 0, tempimpf.getWidth(), tempimpf.getHeight(), endSlice);
            channel2front.setStack(new_impf);
            channel2front.setCalibration(copyCalibration);

            tempimpb = channel2back.getStack();
            new_impb = tempimpb.crop(0, 0, startSlice, tempimpb.getWidth(), tempimpb.getHeight(),
                    tempimpb.getSize() - startSlice);
            channel2back.setStack(new_impb);
            channel2back.setCalibration(copyCalibration);

            tempimpf = channel3front.getStack();
            new_impf = tempimpf.crop(0, 0, 0, tempimpf.getWidth(), tempimpf.getHeight(), endSlice);
            channel3front.setStack(new_impf);
            channel3front.setCalibration(copyCalibration);

            tempimpb = channel3back.getStack();
            new_impb = tempimpb.crop(0, 0, startSlice, tempimpb.getWidth(), tempimpb.getHeight(),
                    tempimpb.getSize() - startSlice);
            channel3back.setStack(new_impb);
            channel3back.setCalibration(copyCalibration);
        }
    }

    ImagePlus frontTemplate = new ImagePlus(fTemplate.getTitle(), fTemplate.getStack());
    frontTemplate.setCalibration(fTemplate.getCalibration());
    ImagePlus backTemplate = new ImagePlus(bTemplate.getTitle(), bTemplate.getStack());
    backTemplate.setCalibration(bTemplate.getCalibration());

    if (stitchingMethod != "Front - Back") {

        impf = stackOrientation(impf, stitchingMethod);
        impb = stackOrientation(impb, stitchingMethod);
        frontTemplate = stackOrientation(fTemplate, stitchingMethod);
        backTemplate = stackOrientation(bTemplate, stitchingMethod);
    }

    if (myOVMethod == "Determined") {
        ov = (int) (endSlice - startSlice);

        tempimpf = impf.getStack();
        new_impf = tempimpf.crop(0, 0, 0, tempimpf.getWidth(), tempimpf.getHeight(), endSlice);
        impf.setStack(new_impf);
        impf.setCalibration(copyCalibration);

        tempimpb = impb.getStack();
        new_impb = tempimpb.crop(0, 0, startSlice, tempimpb.getWidth(), tempimpb.getHeight(),
                tempimpb.getSize() - startSlice);
        impb.setStack(new_impb);
        impb.setCalibration(copyCalibration);

        tempimpf = frontTemplate.getStack();
        new_impf = tempimpf.crop(0, 0, 0, tempimpf.getWidth(), tempimpf.getHeight(), endSlice);
        frontTemplate.setStack(new_impf);
        frontTemplate.setCalibration(copyCalibration);

        tempimpb = backTemplate.getStack();
        new_impb = tempimpb.crop(0, 0, startSlice, tempimpb.getWidth(), tempimpb.getHeight(),
                tempimpb.getSize() - startSlice);
        backTemplate.setStack(new_impb);
        backTemplate.setCalibration(copyCalibration);

    }

    /*----------------*/

    /* Copy */
    ImagePlus impf2 = new ImagePlus(impf.getTitle(), impf.getStack());
    impf2.setCalibration(impf.getCalibration());

    impAlignedZYX = new ImagePlus(impb.getTitle(), impb.getStack());
    impAlignedZYX.setCalibration(impb.getCalibration());

    if (impb.getStackSize() < ov) {
        IJ.showMessage("The expected overlap exceed the back stack size.");
        return;
    }

    /* SIFT parameters Setting */
    p.modelIndex = 3; // 1: Rigid Model, 3 : Affine Model (include the scale)
    p.sift.fdSize = 4;
    p.sift.fdBins = 8; // Number of tested directions
    p.rod = 0.92f;

    p.maxEpsilon = 25.0f;
    p.minInlierRatio = 0.05f;

    //IJ.log("psift parameters: "+p.sift.initialSigma+" "+p.sift.steps+" "+p.sift.minOctaveSize+" "+p.sift.maxOctaveSize);
    IJ.log("Size of front stack:" + impf.getStack().getSize() + "\n Size of back stack:"
            + impAlignedZYX.getStack().getSize());

    /* Divers Variables */
    ImagePlus impAlignedZYX2;
    boolean showStep = false;

    /** -------------------------- STEP 1: PREPROCESSING -------------------------- */

    /* Log Display */
    IJ.log("* IMAGE STACK REGISTRATION *");
    IJ.log(" ");

    IJ.log("Stitching Orientation " + stitchingMethod);
    IJ.log("MIP Size " + MIP);
    IJ.log(" ");

    /* SIFT Object */
    FloatArray2DSIFT sift = new FloatArray2DSIFT(p.sift);
    SIFT ijSIFT = new SIFT(sift);

    /** -------------------------- STEP 2: OVERLAP EXTRACTION -------------------------- */

    double[] data = new double[12];

    /* Start of the 3D Registration */
    if (Reg3D) {
        for (int l = 1; l <= it; ++l) // Iterations
        {

            ImageStack stackZf = impf.getStack();
            ImageStack stackZb = impAlignedZYX.getStack();

            fsf.clear();
            fsb.clear();

            int l2 = 3 * l - 2;
            IJ.log("STEP " + l2 + ": BEST Z ROTATION");

            /** Find Back Image Overlap  according to the selected method */
            if (myOVMethod == "Slice-by-Slice" || myOVMethod == "Determined") {
                indb = OverlapFinder(stackZf, stackZb, ijSIFT, 1, ov);
            } else if (myOVMethod == "Block-by-Block") {
                indb = recursiveOverlapFinder(stackZf, stackZb, ijSIFT, stackZb.getSize(), split);
            }

            IJ.log(" Overlap Size " + indb);

            ImageStack subStackZf = stackZf.crop(0, 0, stackZf.getSize() - indb, stackZf.getWidth(),
                    stackZf.getHeight(), indb);
            ImageStack subStackZb = stackZb.crop(0, 0, 0, stackZb.getWidth(), stackZb.getHeight(), indb);
            fsf.clear();
            fsb.clear();

            AbstractAffineModel2D<?> BestModelZ = CompareCrossSection(subStackZf, subStackZb, ijSIFT, MIP);
            IJ.log("STEP 2");

            /* Back Substack Affine Registration */
            if (modelFound) {
                Model3D(null, null, BestModelZ);
                impAlignedZYX = Rotation3D(impb, BestModel3D);
            } else {
                IJ.log("No model found for the data");
            }

            /* Show intermediate transformation matrix */
            BestModel3D.toArray(data);
            IJ.log("1| " + data[0] + "\t| " + data[3] + "\t| " + data[6] + "\t| " + data[9]);
            IJ.log("2| " + data[1] + "\t| " + data[4] + "\t| " + data[7] + "\t| " + data[10]);
            IJ.log("3| " + data[2] + "\t| " + data[5] + "\t| " + data[8] + "\t| " + data[11]);

            /** -------------------------- STEP 3: BEST X ROTATION -------------------------- */

            l2 = 3 * l - 1;
            IJ.log(" ");
            IJ.log("STEP " + l2 + ": BEST X ROTATION");

            /* Parameter setting */
            fsf.clear();
            fsb.clear();

            /* Rotation of the front substack around y */
            impf = StackRotation(impf, 0, 90, 0);
            ImageStack stackYf = impf.getStack();

            /* Rotation of the back substack around y */
            impAlignedZYX = StackRotation(impAlignedZYX, 0, 90, 0);
            ImageStack stackYb = impAlignedZYX.getStack();

            /* Cropping the overlap */
            ImageStack subStackYf = stackYf.crop(stackYf.getWidth() - indb, 0, 0, indb, stackYf.getHeight(),
                    stackYf.getSize());
            ImageStack subStackYb = stackYb.crop(0, 0, 0, indb, stackYb.getHeight(), stackYb.getSize());

            /* Comparison */
            AbstractAffineModel2D<?> BestModelX = CompareCrossSection(subStackYf, subStackYb, ijSIFT, MIP);

            /* Alignment */
            if (modelFound) {
                Model3D(BestModelX, null, null);
                impAlignedZYX = Rotation3D(impb, BestModel3D);
                if (showStep) {
                    impAlignedZYX2 = StackRotation(impAlignedZYX, 0, 90, 0);
                    impAlignedZYX2.setTitle(String.valueOf(l2));
                    impAlignedZYX2.show();
                }
            } else {
                IJ.log("No model found for the data");
                impAlignedZYX = StackRotation(impAlignedZYX, 0, -90, 0);
            }

            /* Transformation matrix */
            BestModel3D.toArray(data);
            IJ.log("1| " + data[0] + "\t| " + data[3] + "\t| " + data[6] + "\t| " + data[9]);
            IJ.log("2| " + data[1] + "\t| " + data[4] + "\t| " + data[7] + "\t| " + data[10]);
            IJ.log("3| " + data[2] + "\t| " + data[5] + "\t| " + data[8] + "\t| " + data[11]);

            /* Show intermediate steps */
            //impAlignedZYX.setTitle(String.valueOf( l2 ));
            //impAlignedZYX.show();

            /** -------------------------- STEP 4: BEST Y ROTATION -------------------------- */

            IJ.log(" ");
            IJ.log("STEP " + 3 * l + ": BEST Y ROTATION");

            /* Parameter setting */
            fsf.clear();
            fsb.clear();

            /* Rotation of the front substack around x */
            impf = StackRotation(impf2, -90, 0, 0);
            ImageStack stackXf = impf.getStack();

            /* Rotation of the back substack around x */
            impAlignedZYX = StackRotation(impAlignedZYX, -90, 0, 0);
            ImageStack stackXb = impAlignedZYX.getStack();

            /* Cropping the overlap */
            ImageStack subStackXf = stackXf.crop(0, stackXf.getHeight() - indb, 0, stackXf.getWidth(), indb,
                    stackXf.getSize());
            ImageStack subStackXb = stackXb.crop(0, 0, 0, stackXb.getWidth(), indb, stackXb.getSize());

            /* Comparison */
            AbstractAffineModel2D<?> BestModelY = CompareCrossSection(subStackXf, subStackXb, ijSIFT, MIP);

            if (modelFound) {
                Model3D(null, BestModelY, null);
                impAlignedZYX = Rotation3D(impb, BestModel3D);
                if (showStep) {
                    impAlignedZYX2 = StackRotation(impAlignedZYX, -90, 0, 0);
                    impAlignedZYX2.setTitle(String.valueOf(3 * l));
                    impAlignedZYX2.show();
                }
            } else {
                IJ.log("No model found for the data");
                impAlignedZYX = StackRotation(impAlignedZYX, 90, 0, 0);

            }

            /* Transformation matrix */
            BestModel3D.toArray(data);
            IJ.log("1| " + data[0] + "\t| " + data[3] + "\t| " + data[6] + "\t| " + data[9]);
            IJ.log("2| " + data[1] + "\t| " + data[4] + "\t| " + data[7] + "\t| " + data[10]);
            IJ.log("3| " + data[2] + "\t| " + data[5] + "\t| " + data[8] + "\t| " + data[11]);
            IJ.log(" ");

            /** -------------------------- REPLACE L'IMAGE COMME AU DEBUT -------------------------- */

            impf = impf2.duplicate();

        } // End of the iteration loop
    } // End of the 3D Registration

    /** -------------------------- LAST OVERLAP EXTRACTION -------------------------- */

    int l2 = 3 * it + 1;
    IJ.log("STEP " + l2 + ": BEST Z ROTATION");

    fsf.clear();
    fsb.clear();

    ImageStack stackZf = impf.getStack();
    //impAlignedZYX=Rotation3D(impb, BestModel3D);
    ImageStack stackZb = impAlignedZYX.getStack();

    /* Find Back Image Overlap */
    fsf.clear();
    fsb.clear();
    int start = 1;
    int end = stackZb.getSize();
    if (Reg3D == true) {
        start = indb - 250;
        if (start < 10) {
            start = 1;
        }
        end = indb + 250;
        if (end > stackZb.getSize()) {

            end = Math.max(stackZb.getSize(), stackZf.getSize());
        }
    }
    //IJ.log("start: "+ start+" end:"+ end);

    /* Find the overlap using the slice-by-slice method */
    indb = OverlapFinder(stackZf, stackZb, ijSIFT, start, end);
    //IJ.log( " size front:"+stackZf.getSize() +"  size back:"+ stackZb.getSize()+"  overlap:"+ indb);

    /* Cropping the overlap */
    ImageStack subStackZf = stackZf.crop(0, 0, stackZf.getSize() - indb, stackZf.getWidth(),
            stackZf.getHeight(), indb);
    ImageStack subStackZb = stackZb.crop(0, 0, 0, stackZb.getWidth(), stackZb.getHeight(), indb);

    /* Comparison */
    fsf.clear();
    fsb.clear();
    if (indb < MIP) {
        MIP = indb;
    }
    AbstractAffineModel2D<?> BestModelZ = CompareCrossSection(subStackZf, subStackZb, ijSIFT, MIP);

    /* Alignment */
    if (modelFound) {
        Model3D(null, null, BestModelZ);
        impAlignedZYX = Rotation3D(impb, BestModel3D);
        impAlignedZYX.setCalibration(copyCalibration);
        if (template_bool == true) {
            impAlignedZYX = Rotation3D(backTemplate, BestModel3D);
            impAlignedZYX.setCalibration(copyCalibration);
            impf = new ImagePlus(frontTemplate.getTitle(), frontTemplate.getStack());
        }
    } else {
        IJ.log("No model found for the data");
    }

    /* Transformation matrix */
    BestModel3D.toArray(data);
    IJ.log("1| " + data[0] + "\t|" + data[3] + "\t|" + data[6] + "\t|" + data[9]);
    IJ.log("2| " + data[1] + "\t|" + data[4] + "\t|" + data[7] + "\t|" + data[10]);
    IJ.log("3| " + data[2] + "\t|" + data[5] + "\t|" + data[8] + "\t|" + data[11]);

    /* Show final back stack */
    //impAlignedZYX.setTitle("Final Back Stack"); 
    //impAlignedZYX.show();

    /** -------------------------- IMAGE FUSION -------------------------- */

    IJ.log(" ");
    IJ.log("STEP: IMAGE FUSION");

    String title = "Fused Image";
    if (c2 || c3) {
        title = title + " Channel1";
    }

    /* Channel 1 fusion */
    ImagePlus FinalImg = fuseImages(impf, impAlignedZYX, indb, fusionMethod, title, copyCalibration);
    if (stitchingMethod != "Front - Back") {
        FinalImg = reverseStackOrientation(FinalImg, stitchingMethod);
    }
    FinalImg.show();
    FinalImg.draw();

    /* Channel 2 fusion */
    if (c2) {
        ImagePlus impAligned2 = Rotation3D(channel2back, BestModel3D);
        ImagePlus FinalImg2 = fuseImages(channel2front, impAligned2, indb, fusionMethod, "Fused Image Channel2",
                copyCalibration);
        if (stitchingMethod != "Front - Back") {
            FinalImg2 = reverseStackOrientation(FinalImg2, stitchingMethod);
        }
        FinalImg2.show();
        FinalImg2.draw();
    }

    /* Channel 3 fusion */
    if (c3) {
        ImagePlus impAligned3 = Rotation3D(channel3back, BestModel3D);
        ImagePlus FinalImg3 = fuseImages(channel3front, impAligned3, indb, fusionMethod, "Fused Image Channel3",
                copyCalibration);
        if (stitchingMethod != "Front - Back") {
            FinalImg3 = reverseStackOrientation(FinalImg3, stitchingMethod);
        }
        FinalImg3.show();
        FinalImg3.draw();
    }

    fsf.clear();
    fsb.clear();

    IJ.log(" took " + (System.currentTimeMillis() - start_time) + "ms");

    IJ.log("* Done *");
    IJ.log(" ");
    Toolkit.getDefaultToolkit().beep();
}

From source file:net.sf.dynamicreports.test.jasper.chart.XyBlockChartTest.java

@Override
public void test() {
    super.test();

    numberOfPagesTest(1);//from  ww  w  .j av  a2 s  .c  o  m

    JFreeChart chart = getChart("summary.chart1", 0);
    XYItemRenderer renderer = chart.getXYPlot().getRenderer();
    Assert.assertEquals("renderer", XYBlockRenderer.class, renderer.getClass());
    Assert.assertEquals("block width", 1.1, ((XYBlockRenderer) renderer).getBlockWidth());
    Assert.assertEquals("block height", 0.9, ((XYBlockRenderer) renderer).getBlockHeight());
    Assert.assertEquals("block anchor", org.jfree.ui.RectangleAnchor.BOTTOM_LEFT,
            ((XYBlockRenderer) renderer).getBlockAnchor());

    Assert.assertEquals("paintScale", LookupPaintScale.class,
            ((XYBlockRenderer) renderer).getPaintScale().getClass());
    LookupPaintScale paintScale = (LookupPaintScale) ((XYBlockRenderer) renderer).getPaintScale();
    Assert.assertEquals("paintScale default lower bound", 0.1, paintScale.getLowerBound());
    Assert.assertEquals("paintScale default upper bound", 5d, paintScale.getUpperBound());
    Assert.assertEquals("paintScale default paint", Color.WHITE, paintScale.getDefaultPaint());
    Assert.assertEquals("paintScale paint 1", Color.RED, paintScale.getPaint(1));
    Assert.assertEquals("paintScale paint 2", Color.GREEN, paintScale.getPaint(2));
    Assert.assertEquals("paintScale paint 3", Color.BLUE, paintScale.getPaint(3));

    LegendItemCollection legendItems = chart.getXYPlot().getLegendItems();
    Assert.assertEquals("legend item 1 label", "1", legendItems.get(0).getLabel());
    Assert.assertEquals("legend item 1 paint", Color.RED, legendItems.get(0).getFillPaint());
    Assert.assertEquals("legend item 2 label", "2", legendItems.get(1).getLabel());
    Assert.assertEquals("legend item 2 paint", Color.GREEN, legendItems.get(1).getFillPaint());
    Assert.assertEquals("legend item 3 label", "3", legendItems.get(2).getLabel());
    Assert.assertEquals("legend item 3 paint", Color.BLUE, legendItems.get(2).getFillPaint());

    xyzChartDataTest(chart, 0, "serie0",
            new Number[][] { { 1d, 2d, 0d }, { 2d, 3d, 1d }, { 3d, 4d, 2d }, { 4d, 5d, 3d } });

    chart = getChart("summary.chart2", 0);
    Axis axis = chart.getXYPlot().getDomainAxis();
    Assert.assertEquals("category label", "category", axis.getLabel());
    Assert.assertEquals("category label color", Color.BLUE, axis.getLabelPaint());
    Assert.assertEquals("category label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
    Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
    Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
    Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());

    chart = getChart("summary.chart3", 0);
    axis = chart.getXYPlot().getRangeAxis();
    Assert.assertEquals("value label", "value", axis.getLabel());
    Assert.assertEquals("value label color", Color.BLUE, axis.getLabelPaint());
    Assert.assertEquals("value label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
    Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
    Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
    Assert.assertEquals("tick label mask", "10.00", ((NumberAxis) axis).getNumberFormatOverride().format(10));
    Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());
}

From source file:com.univocity.app.swing.DataAnalysisWindow.java

protected JLabel getSearchLabel() {
    if (searchLabel == null) {
        searchLabel = new JLabel("Search:");
        searchLabel.setFont(new Font("Arial", Font.BOLD, 10));
    }//from   ww w  .  j  a  v a  2  s  . co  m
    return searchLabel;
}

From source file:grafix.graficos.eixos.Eixo.java

protected IntervalMarker gerarIntervalMarker(final MarcaGrafica m, JanelaGraficos janela) {
    try {/*from w  w  w .j  av  a 2  s . c om*/
        IntervalMarker im = new IntervalMarker(m.getInicioNoGrafico(janela).getFirstMillisecond(),
                m.getFimNoGrafico(janela).getFirstMillisecond());
        im.setLabelOffsetType(LengthAdjustmentType.EXPAND);
        im.setPaint(m.getCor());
        im.setStroke(new BasicStroke(1.4f));
        if (!m.getFim().equals(m.getInicio())) {
            im.setAlpha(.2f);
            im.setLabelFont(new Font("SansSerif", Font.BOLD, 11));
        } else {
            im.setAlpha(.9f);
            im.setLabelFont(new Font("SansSerif", Font.PLAIN, 11));
        }
        im.setLabel(m.getTag());
        im.setLabelPaint(m.getCor());
        im.setLabelAnchor(RectangleAnchor.TOP_LEFT);
        im.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
        return im;
    } catch (Exception e) {
        return null;
    }
}

From source file:PlotDriver.java

void setFont(String fName, int fSize) {
    font = new Font(fName, Font.BOLD, fSize);
    fontMetrics = p.getFontMetrics(font);
}

From source file:com.willwinder.ugs.nbp.setupwizard.panels.WizardPanelStepCalibration.java

private void addHeaderRow(JPanel panel) {
    Font labelHeaderFont = new Font(Font.SANS_SERIF, Font.BOLD, 16);
    JLabel headerLabel = new JLabel(Localization.getString("platform.plugin.setupwizard.move"), JLabel.CENTER);
    headerLabel.setFont(labelHeaderFont);
    panel.add(headerLabel, "growx, spanx 3, gapbottom 5, gaptop 7");
    panel.add(new JSeparator(SwingConstants.VERTICAL), "spany 5, gapleft 5, gapright 5, wmin 10, grow");

    headerLabel = new JLabel(Localization.getString("platform.plugin.setupwizard.measure"), JLabel.CENTER);
    headerLabel.setFont(labelHeaderFont);
    panel.add(headerLabel, "growx, spanx 2, gapbottom 5, gaptop 7");
    panel.add(new JSeparator(SwingConstants.VERTICAL), "spany 5, gapleft 5, gapright 5, wmin 10, grow");

    headerLabel = new JLabel(Localization.getString("platform.plugin.setupwizard.calibrate"), JLabel.CENTER);
    headerLabel.setFont(labelHeaderFont);
    panel.add(headerLabel, "growx, spanx 3, wrap, gapbottom 5, gaptop 7");
}

From source file:daylightchart.daylightchart.chart.DaylightChart.java

/**
 * Creates the daylight chart./*w ww . ja  va2 s  .  c om*/
 */
private void createChart(final Options options) {

    setBackgroundPaint(Color.white);

    final XYPlot plot = getXYPlot();

    // Set the first renderer, so that the grid lines can be shown
    plot.setRenderer(new StandardXYItemRenderer());
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);

    plot.setBackgroundPaint(ChartConfiguration.nightColor);

    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    createMonthsAxis(plot);
    createHoursAxis(plot);

    // Create a marker region for daylight savings time
    if (riseSetData.usesDaylightTime()) {
        createDSTMarker(plot);
    }

    createBandsInPlot(plot);

    ChartOrientation chartOrientation = ChartOrientation.STANDARD;
    if (options != null) {
        chartOrientation = options.getChartOrientation();
    }
    adjustForChartOrientation(chartOrientation);

    final Options optionsNotNull;
    if (options == null) {
        optionsNotNull = new Options();
    } else {
        optionsNotNull = options;
    }
    createTitles(optionsNotNull.getChartOptions(), ChartConfiguration.chartFont.deriveFont(Font.BOLD, 18));

    createLegend(optionsNotNull, ChartConfiguration.chartFont.deriveFont(Font.PLAIN, 12));

}

From source file:net.sf.taverna.t2.activities.wsdlsir.views.WSDLActivityConfigurationView.java

private void initComponents() {

    this.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL);

    int gridy = 0;

    // title panel
    JPanel titlePanel = new JPanel(new BorderLayout());
    titlePanel.setBackground(Color.WHITE);
    JLabel titleLabel = new JLabel("Security configuration");
    titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD, 13.5f));
    titleLabel.setBorder(new EmptyBorder(10, 10, 0, 10));
    DialogTextArea titleMessage = new DialogTextArea("Select a security profile for the service");
    titleMessage.setMargin(new Insets(5, 20, 10, 10));
    titleMessage.setFont(titleMessage.getFont().deriveFont(11f));
    titleMessage.setEditable(false);/*from  www  . ja v  a2 s  .c o m*/
    titleMessage.setFocusable(false);
    titlePanel.setBorder(new EmptyBorder(10, 10, 0, 10));
    titlePanel.add(titleLabel, BorderLayout.NORTH);
    titlePanel.add(titleMessage, BorderLayout.CENTER);
    addDivider(titlePanel, SwingConstants.BOTTOM, true);

    // Main panel
    JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new GridBagLayout());
    mainPanel.setBorder(new EmptyBorder(10, 10, 10, 10));

    //Create the radio buttons
    noSecurityRadioButton = new JRadioButton("None");
    noSecurityRadioButton.addItemListener(this);

    wsSecurityAuthNRadioButton = new JRadioButton("WS-Security username and password authentication");
    wsSecurityAuthNRadioButton.addItemListener(this);

    httpSecurityAuthNRadioButton = new JRadioButton("HTTP username and password authentication");
    httpSecurityAuthNRadioButton.addItemListener(this);

    SAMLSecurityAuthNRadioButton = new JRadioButton("SAML WEB SSO profile authentication");
    SAMLSecurityAuthNRadioButton.addItemListener(this);

    //Group the radio buttons
    buttonGroup = new ButtonGroup();
    buttonGroup.add(noSecurityRadioButton);
    buttonGroup.add(wsSecurityAuthNRadioButton);
    buttonGroup.add(httpSecurityAuthNRadioButton);
    buttonGroup.add(SAMLSecurityAuthNRadioButton);

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.weightx = 1.0;
    gbc.weighty = 0.0;

    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(5, 10, 0, 0);
    mainPanel.add(noSecurityRadioButton, gbc);

    noSecurityLabel = new JLabel("Service requires no security");
    noSecurityLabel.setFont(noSecurityLabel.getFont().deriveFont(11f));
    //      addDivider(noSecurityLabel, SwingConstants.BOTTOM, false);
    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(0, 40, 10, 10);
    mainPanel.add(noSecurityLabel, gbc);

    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(5, 10, 0, 0);
    mainPanel.add(httpSecurityAuthNRadioButton, gbc);

    ActionListener usernamePasswordListener = new ActionListener() {

        public void actionPerformed(ActionEvent e) {

            // Get Credential Manager UI to get the username and password for the service
            CredentialManagerUI credManagerUI = CredentialManagerUI.getInstance();
            if (credManagerUI != null)
                credManagerUI.newPasswordForService(oldBean.getWsdl());
        }
    };

    httpSecurityAuthNLabel = new JLabel(
            "Service requires HTTP username and password in order to authenticate the user");
    httpSecurityAuthNLabel.setFont(httpSecurityAuthNLabel.getFont().deriveFont(11f));
    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(0, 40, 10, 10);
    mainPanel.add(httpSecurityAuthNLabel, gbc);

    // Set username and password button;
    setHttpUsernamePasswordButton = new JButton("Set username and password");
    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.insets = new Insets(0, 40, 10, 10);
    gbc.weightx = 1.0;
    gbc.weighty = 1.0; // add any vertical space to this component
    mainPanel.add(setHttpUsernamePasswordButton, gbc);
    setHttpUsernamePasswordButton.addActionListener(usernamePasswordListener);

    /////SAML

    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(5, 10, 0, 0);
    mainPanel.add(SAMLSecurityAuthNRadioButton, gbc);

    ActionListener getCookieListener = new ActionListener() {

        /**
         * This listener will use the CallPreparator to obtain the cookies (included shibsession_XXX cookie) and 
         * save it in the Credential Manager (as the password for user "nomatter")
         */
        public void actionPerformed(ActionEvent e) {
            try {
                WSDLParser parser = new WSDLParser(newBean.getWsdl());
                List<String> endpoints = parser.getOperationEndpointLocations(newBean.getOperation());
                for (String endpoint : endpoints) //Actually i am only expecting one endpoint
                {
                    if (debug)
                        System.out
                                .println("Obtaining a SAML cookies to save in credential manager:" + endpoint);

                    Cookie[] cookies = CallPreparator.createCookieForCallToEndpoint(endpoint);

                    // Uncomment for just the shibsession cookie
                    //                  Cookie[] cookiessession = new Cookie[1];
                    //                  for (Cookie cook : cookies)
                    //                     if (cook.getName().contains("shibsession"))
                    //                        cookiessession[0]=cook;
                    //                  cookies=cookiessession;

                    CredentialManager credman = CredentialManager.getInstance();
                    credman.saveUsernameAndPasswordForService(
                            new UsernamePassword("nomatter", serializetoString(cookies)), new URI(endpoint));
                }
            } catch (WSDLException ex) {
                System.err.println(
                        "Problem getting or saving SAML cookie: " + newBean.getWsdl() + ". " + ex.getMessage());
                ex.printStackTrace();
            } catch (ParserConfigurationException ex) {
                System.err.println(
                        "Problem getting or saving SAML cookie: " + newBean.getWsdl() + ". " + ex.getMessage());
                ex.printStackTrace();
            } catch (Exception ex) {
                System.err.println(
                        "Problem getting or saving SAML cookie: " + newBean.getWsdl() + ". " + ex.getMessage());
                ex.printStackTrace();
            }
        }
    };

    SAMLSecurityAuthNLabel = new JLabel("<html>"
            + "Service requires SAML Web SSO profile to be perfomed in order to authenticate the user. "
            + "A cookie will be saved in your Credential Manger. "
            + "In the case that it stops working, please delete the entry in your Credential Manager or re-authenticate"
            + "</html>");
    SAMLSecurityAuthNLabel.setFont(SAMLSecurityAuthNLabel.getFont().deriveFont(11f));
    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(3, 40, 10, 10);
    mainPanel.add(SAMLSecurityAuthNLabel, gbc);

    // Set username and password button;
    setSAMLGETCookieButton = new JButton("Authenticate and save Authentication data in Credential Manger");
    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.insets = new Insets(0, 40, 10, 10);
    gbc.weightx = 1.0;
    gbc.weighty = 1.0; // add any vertical space to this component
    mainPanel.add(setSAMLGETCookieButton, gbc);
    setSAMLGETCookieButton.addActionListener(getCookieListener);

    //END SAML

    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(5, 10, 0, 0);
    mainPanel.add(wsSecurityAuthNRadioButton, gbc);

    wsSecurityAuthNLabel = new JLabel(
            "Service requires WS-Security username and password in order to authenticate the user");
    wsSecurityAuthNLabel.setFont(wsSecurityAuthNLabel.getFont().deriveFont(11f));
    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(0, 40, 0, 0);
    mainPanel.add(wsSecurityAuthNLabel, gbc);

    // Password type list
    passwordTypeComboBox = new JComboBox(passwordTypes);
    passwordTypeComboBox.setRenderer(new ComboBoxTooltipRenderer());
    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(10, 40, 0, 0);
    mainPanel.add(passwordTypeComboBox, gbc);

    // 'Add timestamp' checkbox
    addTimestampCheckBox = new JCheckBox("Add a timestamp to SOAP message");
    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(5, 40, 10, 10);
    mainPanel.add(addTimestampCheckBox, gbc);

    // Set username and password button;
    setWsdlUsernamePasswordButton = new JButton("Set username and password");
    gbc.gridx = 0;
    gbc.gridy = gridy++;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.insets = new Insets(0, 40, 10, 10);
    gbc.weightx = 1.0;
    gbc.weighty = 1.0; // add any vertical space to this component
    mainPanel.add(setWsdlUsernamePasswordButton, gbc);
    setWsdlUsernamePasswordButton.addActionListener(usernamePasswordListener);

    addDivider(mainPanel, SwingConstants.BOTTOM, true);

    // OK/Cancel button panel
    JPanel okCancelPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            okPressed();
        }
    });
    JButton cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            cancelPressed();
        }
    });
    okCancelPanel.add(cancelButton);
    okCancelPanel.add(okButton);

    // Enable/disable controls based on what is the current security profiles
    String securityProfile = oldBean.getSecurityProfile();
    if (securityProfile == null) {
        noSecurityRadioButton.setSelected(true);
    } else {
        if (securityProfile.equals(SecurityProfiles.WSSECURITY_USERNAMETOKEN_PLAINTEXTPASSWORD)
                || securityProfile.equals(SecurityProfiles.WSSECURITY_USERNAMETOKEN_DIGESTPASSWORD)
                || securityProfile.equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_PLAINTEXTPASSWORD)
                || securityProfile.equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_DIGESTPASSWORD)) {
            wsSecurityAuthNRadioButton.setSelected(true);
        }
        if (securityProfile.equals(SecurityProfiles.HTTP_BASIC_AUTHN)
                || securityProfile.equals(SecurityProfiles.HTTP_DIGEST_AUTHN)) {
            httpSecurityAuthNRadioButton.setSelected(true);
        }
        if (securityProfile.equals(SecurityProfiles.SAMLWEBSSOAUTH)) {
            SAMLSecurityAuthNRadioButton.setSelected(true);
        }
        if (securityProfile.equals(SecurityProfiles.WSSECURITY_USERNAMETOKEN_PLAINTEXTPASSWORD)
                || securityProfile
                        .equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_PLAINTEXTPASSWORD)) {
            passwordTypeComboBox.setSelectedItem(PLAINTEXT_PASSWORD);
        } else if (securityProfile.equals(SecurityProfiles.WSSECURITY_USERNAMETOKEN_DIGESTPASSWORD)
                || securityProfile.equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_DIGESTPASSWORD)) {
            passwordTypeComboBox.setSelectedItem(DIGEST_PASSWORD);
        }
        if (securityProfile.equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_DIGESTPASSWORD)
                || securityProfile
                        .equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_PLAINTEXTPASSWORD)) {
            addTimestampCheckBox.setSelected(true);
        } else {
            addTimestampCheckBox.setSelected(false);
        }
    }

    // Put everything together
    JPanel layoutPanel = new JPanel(new BorderLayout());
    layoutPanel.add(titlePanel, BorderLayout.NORTH);
    layoutPanel.add(mainPanel, BorderLayout.CENTER);
    layoutPanel.add(okCancelPanel, BorderLayout.SOUTH);
    layoutPanel.setPreferredSize(new Dimension(550, 490));

    this.getContentPane().add(layoutPanel);
    this.pack();
}

From source file:it.eng.spagobi.engines.kpi.bo.charttypes.trendcharts.LineChart.java

public JFreeChart createChart() {

    logger.debug("IN");
    CategoryPlot plot = new CategoryPlot();
    IMessageBuilder msgBuilder = MessageBuilderFactory.getMessageBuilder();
    String rangeAxisName = msgBuilder.getMessage("sbi.kpi.rangeAxisName");
    NumberAxis rangeAxis = new NumberAxis(rangeAxisName);
    rangeAxis.setLabelFont(new Font("Arial", Font.PLAIN, 12));
    Color colorLabel = Color.decode("#000000");
    rangeAxis.setLabelPaint(colorLabel);
    rangeAxis.setTickLabelFont(new Font("Arial", Font.PLAIN, 10));
    rangeAxis.setTickLabelPaint(colorLabel);
    plot.setRangeAxis(rangeAxis);//from   w w w .  j a  v a 2 s  . c o  m

    CategoryAxis domainAxis = new CategoryAxis();
    domainAxis.setLabelFont(new Font("Arial", Font.PLAIN, 10));
    domainAxis.setLabelPaint(colorLabel);
    domainAxis.setTickLabelFont(new Font("Arial", Font.PLAIN, 10));
    domainAxis.setTickLabelPaint(colorLabel);
    plot.setDomainAxis(domainAxis);

    plot.setOrientation(PlotOrientation.VERTICAL);
    plot.setRangeGridlinesVisible(true);
    plot.setDomainGridlinesVisible(true);

    //I create a line renderer 
    MyStandardCategoryItemLabelGenerator generator = null;

    LineAndShapeRenderer lineRenderer = new LineAndShapeRenderer();
    lineRenderer.setShapesFilled(true);
    lineRenderer.setBaseItemLabelGenerator(generator);
    lineRenderer.setBaseItemLabelFont(new Font("Arial", Font.PLAIN, 12));
    lineRenderer.setBaseItemLabelPaint(colorLabel);
    lineRenderer.setBaseItemLabelsVisible(true);

    DefaultCategoryDataset datasetLine = (DefaultCategoryDataset) datasetMap.getDatasets().get("line");

    for (Iterator iterator = datasetLine.getRowKeys().iterator(); iterator.hasNext();) {
        String serName = (String) iterator.next();
        String labelName = "";
        int index = -1;
        index = datasetLine.getRowIndex(serName);

        Color color = Color.decode("#990200");
        lineRenderer.setSeriesPaint(index, color);
    }

    plot.setDataset(0, datasetLine);
    plot.setRenderer(0, lineRenderer);

    plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45);
    JFreeChart chart = new JFreeChart(plot);
    logger.debug("Chart created");
    TextTitle title = new TextTitle(name, new Font("Arial", Font.BOLD, 16), Color.decode("#990200"),
            RectangleEdge.TOP, HorizontalAlignment.CENTER, VerticalAlignment.TOP, RectangleInsets.ZERO_INSETS);
    chart.setTitle(title);
    TextTitle subTitle = new TextTitle(subName, new Font("Arial", Font.PLAIN, 12), Color.decode("#000000"),
            RectangleEdge.TOP, HorizontalAlignment.CENTER, VerticalAlignment.TOP, RectangleInsets.ZERO_INSETS);
    chart.addSubtitle(subTitle);
    TextTitle subTitle2 = new TextTitle(subName, new Font("Arial", Font.PLAIN, 8), Color.decode("#FFFFFF"),
            RectangleEdge.TOP, HorizontalAlignment.CENTER, VerticalAlignment.TOP, RectangleInsets.ZERO_INSETS);
    chart.addSubtitle(subTitle2);
    chart.removeLegend();

    chart.setBackgroundPaint(Color.white);
    logger.debug("OUT");
    return chart;
}

From source file:com.att.aro.ui.view.videotab.VideoTab.java

public JLabel getTitle() {
    JLabel VideoResultSummaryLabel = new JLabel(ResourceBundleHelper.getMessageString("videoSummary.title"));
    VideoResultSummaryLabel.setFont(new Font("HeaderFont", Font.BOLD, 18));
    return VideoResultSummaryLabel;
}