Examples of SampleContext


Examples of com.pcmsolutions.device.EMU.E4.sample.SampleContext

    protected JMenuItem[] getCustomMenuItems() {
        JMenuItem smi = null;
        Object[] selObjs = ZUtilities.eliminateInstances(this.getSelObjects(), String.class);
        try {
            SampleContext sc = preset.getDeviceContext().getDefaultSampleContext();
            if (ClassUtility.areAllInstanceOf(selObjs, ReadableParameterModel.class)) {
                ReadableParameterModel[] models = (ReadableParameterModel[]) Arrays.asList(selObjs).toArray(new ReadableParameterModel[selObjs.length]);
                if (ParameterModelUtilities.areAllOfId(models, 38) && !ParameterModelUtilities.areAllOfValue(models, 0)) {
                    Set s = ParameterModelUtilities.getValueSet(models);
                    ReadableSample[] samples = new ReadableSample[s.size()];
                    int si = 0;
                    for (Iterator i = s.iterator(); i.hasNext();)
                        samples[si++] = convertPassThroughSample(sc.getReadableSample((Integer) i.next()));
                    String mstr;
                    if (samples.length == 1)
                        mstr = samples[0].getSampleDisplayName();
                    else
                        mstr = "Selected samples";
View Full Code Here

Examples of com.pcmsolutions.device.EMU.E4.sample.SampleContext

    public SampleContext newContext(SampleContext sc, String name, Integer[] samples) throws NoSuchSampleException, NoSuchContextException {
        if (!assertContext(sc))
            throw new NoSuchContextException();

        SampleContext npc;
        for (int n = 0; n < samples.length; n++)
            if (!hasSample(sc, samples[n]))
                throw new NoSuchSampleException(samples[n]);

        npc = scf.newSampleContext(name, this);
View Full Code Here

Examples of com.pcmsolutions.device.EMU.E4.sample.SampleContext

    private SampleContext getParent(SampleContext sc) {
        return (SampleContext) sc2parentsc.get(sc);
    }

    private boolean releaseSample(SampleContext sc, Integer sample) {
        SampleContext parent = getParent(sc);
        if (parent == null)
            return false;

        transferSample(sc, parent, sample);
View Full Code Here

Examples of com.pcmsolutions.device.EMU.E4.sample.SampleContext

        return true;
    }

    private boolean releaseAllSamples(SampleContext sc) {
        SampleContext parent = getParent(sc);
        if (parent == null)
            return false;

        TreeMap samples = (TreeMap) sc2s.get(sc);
        Iterator i = ((TreeMap) samples.clone()).keySet().iterator(); // this must be cloned because we will updating this very table in transferSample - otherwise we would get a ConcurrentModificationException from the key set
View Full Code Here

Examples of com.pcmsolutions.device.EMU.E4.sample.SampleContext

                    else
                        stripIndex = UserMessaging.askYesNo("All of the sample File names appear to have a sample index appendage. Strip?");
                else
                    stripIndex = UserMessaging.askYesNo(mc + " of the sample File names appear to have a sample index appendage. Strip?");
            }
            SampleContext sc = beginSample.getSampleContext();
            String opt1;
            String opt2;
            try {
                if (SampleContextMacros.areSampleIndexesEmpty(sc, beginSample.getSampleNumber(), files.length)) {
                    SampleContextMacros.loadSamplesToContext(files, ZUtilities.fillIncrementally(new Integer[files.length], beginSample.getSampleNumber().intValue()), beginSample.getSampleContext(), true, stripIndex);
                    return;
                }
            } catch (NoSuchSampleException e) {
                throw new CommandFailedException("No such sample");
            } catch (NoSuchContextException e) {
                throw new CommandFailedException("Problem with sample context");
            }
            if (files.length > 1) {
                opt1 = "At locations " + df.format(beginSample.getSampleNumber()) + " - " + df.format(beginSample.getSampleNumber().intValue() + files.length - 1);
                opt2 = "At first " + files.length + " empty locations searching from " + df.format(beginSample.getSampleNumber());
            } else {
                opt1 = "At location " + df.format(beginSample.getSampleNumber());
                opt2 = "At first empty location searching from " + df.format(beginSample.getSampleNumber());
            }
            int res = JOptionPane.showOptionDialog(ZoeosFrame.getInstance(), (files.length == 1 ? "Load 1 sample" : "Load " + files.length + " samples "), "Load Samples", JOptionPane.OK_OPTION, JOptionPane.QUESTION_MESSAGE, null, new Object[]{opt1, opt2}, opt1);
            if (res == 0) {
                int si = beginSample.getSampleNumber().intValue();
                Integer[] indexes = new Integer[files.length];
                for (int i = 0; i < indexes.length; i++) {
                    indexes[i] = IntPool.get(si + i);
                }
                SampleContextMacros.loadSamplesToContext(files, indexes, beginSample.getSampleContext(), true, stripIndex);
            } else if (res == 1) {
                try {
                    List emptyList = sc.findEmptySamplesInContext(files.length, beginSample.getSampleNumber(), IntPool.get(DeviceContext.MAX_USER_SAMPLE));

                    if (emptyList.size() < files.length)
                        throw new CommandFailedException("Could not find " + files.length + " empty user sample locations.");

                    SampleContextMacros.loadSamplesToContext(files, (Integer[]) emptyList.toArray(new Integer[emptyList.size()]), beginSample.getSampleContext(), true, stripIndex);
View Full Code Here

Examples of org.apache.empire.struts2.websample.web.SampleContext

    {
        if (!isServiceAvailable())
            return new Options(); // Webservice is note not available ... so do nothing

        if (departments == null)
            departments = EmployeeRecord.getDepartments(new SampleContext());

        return departments;
    }
View Full Code Here

Examples of org.apache.empire.struts2.websample.web.SampleContext

    // ------- Action Construction -------

    public EmployeeDetailAction()
    {
        super(new EmployeeRecord(new SampleContext()), SessionPersistence.Key);

    }
View Full Code Here

Examples of org.apache.empire.struts2.websample.web.SampleContext

    {
        if (!isServiceAvailable())
            return new Options(); // Webservice is note not available ... so do nothing

        if (departments == null)
            departments = EmployeeRecord.getDepartments(new SampleContext());

        return departments;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.