Package com.cburch.logisim.analyze.model

Examples of com.cburch.logisim.analyze.model.Entry


    @Override
    public String getToolTipText(MouseEvent event) {
        TruthTable table = model.getTruthTable();
        int row = getRow(event);
        int col = getOutputColumn(event);
        Entry entry = table.getOutputEntry(row, col);
        return entry.getErrorMessage();
    }
View Full Code Here


        y += cellHeight;
        g.setColor(ERROR_COLOR);
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                int row = getTableRow(i, j, rows, cols);
                Entry entry = table.getOutputEntry(row, outputColumn);
                if (provisionalValue != null && row == provisionalY
                        && outputColumn == provisionalX) entry = provisionalValue;
                if (entry.isError()) {
                    g.fillRect(x + j * cellWidth, y + i * cellHeight, cellWidth, cellHeight);
                }
            }
        }

        List<Implicant> implicants = model.getOutputExpressions().getMinimalImplicants(output);
        if (implicants != null) {
            int index = 0;
            for (Implicant imp : implicants) {
                g.setColor(IMP_COLORS[index % IMP_COLORS.length]);
                paintImplicant(g, imp, x, y, rows, cols);
                index++;
            }
        }

        g.setColor(Color.GRAY);
        if (cols > 1 || inputCount == 0) {
            g.drawLine(x, y, left + tableWidth, y);
        }

        if (rows > 1 || inputCount == 0) {
            g.drawLine(x, y, x, top + tableHeight);
        }

        if (outputColumn < 0) {
            return;
        }


        g.setColor(Color.BLACK);
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                int row = getTableRow(i, j, rows, cols);
                if (provisionalValue != null && row == provisionalY
                        && outputColumn == provisionalX) {
                    String text = provisionalValue.getDescription();
                    g.setColor(Color.GREEN);
                    g.drawString(text,
                            x + j * cellWidth + (cellWidth - fm.stringWidth(text)) / 2,
                            y + i * cellHeight + dy);
                    g.setColor(Color.BLACK);
                } else {
                    Entry entry = table.getOutputEntry(row, outputColumn);
                    String text = entry.getDescription();
                    g.drawString(text,
                            x + j * cellWidth + (cellWidth - fm.stringWidth(text)) / 2,
                            y + i * cellHeight + dy);
                }
            }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.analyze.model.Entry

Copyright © 2018 www.massapicom. 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.