Search in sources :

Example 1 with DataTablePopupMenu

use of com.att.aro.ui.model.DataTablePopupMenu in project VideoOptimzer by attdevsupport.

the class BPAdaptiveBitrateTablePanel method getContentTable.

@SuppressWarnings("unchecked")
public DataTable<QualityTime> getContentTable() {
    if (contentTable == null) {
        contentTable = new DataTable<QualityTime>(tableModel);
        contentTable.setName(ResourceBundleHelper.getMessageString("video.adaptive.bitrate.tableName"));
        contentTable.setAutoCreateRowSorter(true);
        contentTable.setGridColor(Color.LIGHT_GRAY);
        contentTable.setRowHeight(ROW_HEIGHT);
        contentTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
        TableRowSorter<TableModel> sorter = new TableRowSorter<>(tableModel);
        contentTable.setRowSorter(sorter);
        sorter.toggleSortOrder(AdaptiveBitrateTableModel.COL_2);
        sorter.setComparator(AdaptiveBitrateTableModel.COL_3, Util.getFloatSorter());
        sorter.toggleSortOrder(AdaptiveBitrateTableModel.COL_4);
        sorter.setComparator(AdaptiveBitrateTableModel.COL_5, Util.getFloatSorter());
        sorter.setComparator(AdaptiveBitrateTableModel.COL_6, Util.getFloatSorter());
        sorter.setComparator(AdaptiveBitrateTableModel.COL_7, Util.getFloatSorter());
        sorter.setComparator(AdaptiveBitrateTableModel.COL_8, Util.getFloatSorter());
        // set default sort
        sorter.toggleSortOrder(AdaptiveBitrateTableModel.COL_1);
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) contentTable.getPopup();
        popupMenu.initialize();
    }
    return contentTable;
}
Also used : QualityTime(com.att.aro.core.videoanalysis.pojo.QualityTime) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu) AdaptiveBitrateTableModel(com.att.aro.ui.model.bestpractice.AdaptiveBitrateTableModel) TableModel(javax.swing.table.TableModel) TableRowSorter(javax.swing.table.TableRowSorter)

Example 2 with DataTablePopupMenu

use of com.att.aro.ui.model.DataTablePopupMenu in project VideoOptimzer by attdevsupport.

the class BPVideoStallTablePanel method getContentTable.

@SuppressWarnings("unchecked")
public DataTable<VideoStall> getContentTable() {
    if (contentTable == null) {
        contentTable = new DataTable<VideoStall>(tableModel);
        contentTable.setName(ResourceBundleHelper.getMessageString("video.stalls.tableName"));
        contentTable.setAutoCreateRowSorter(true);
        contentTable.setGridColor(Color.LIGHT_GRAY);
        contentTable.setRowHeight(ROW_HEIGHT);
        contentTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
        TableRowSorter<TableModel> sorter = new TableRowSorter<>(tableModel);
        contentTable.setRowSorter(sorter);
        sorter.setComparator(VideoStallTableModel.COL_2, Util.getIntSorter());
        sorter.setComparator(VideoStallTableModel.COL_3, Util.getFloatSorter());
        sorter.setComparator(VideoStallTableModel.COL_4, Util.getFloatSorter());
        sorter.setComparator(VideoStallTableModel.COL_5, Util.getFloatSorter());
        sorter.toggleSortOrder(SimultnsConnTableModel.COL_1);
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) contentTable.getPopup();
        popupMenu.initialize();
    }
    return contentTable;
}
Also used : DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu) SimultnsConnTableModel(com.att.aro.ui.model.bestpractice.SimultnsConnTableModel) VideoStallTableModel(com.att.aro.ui.model.bestpractice.VideoStallTableModel) TableModel(javax.swing.table.TableModel) TableRowSorter(javax.swing.table.TableRowSorter) VideoStall(com.att.aro.core.packetanalysis.pojo.VideoStall)

Example 3 with DataTablePopupMenu

use of com.att.aro.ui.model.DataTablePopupMenu in project VideoOptimzer by attdevsupport.

the class DiagnosticsTab method getJPacketViewTable.

/**
 * Initializes and returns the Packet View Table.
 */
public DataTable<PacketInfo> getJPacketViewTable() {
    if (jPacketViewTable == null) {
        jPacketViewTable = new DataTable<PacketInfo>(jPacketViewTableModel);
        jPacketViewTable.setName(ResourceBundleHelper.getMessageString("diagnostics.packet.view.tableName"));
        jPacketViewTable.setAutoCreateRowSorter(true);
        jPacketViewTable.setGridColor(Color.LIGHT_GRAY);
        jPacketViewTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

            PacketInfo packetInfo;

            @Override
            public void valueChanged(ListSelectionEvent arg0) {
                PacketInfo packetInfo = jPacketViewTable.getSelectedItem();
                if (packetInfo != null && packetInfo != this.packetInfo) {
                    double crossHairValue = packetInfo.getTimeStamp();
                    boolean centerGraph = !(crossHairValue <= graphPanel.getViewportUpperBound() && crossHairValue >= graphPanel.getViewportLowerBound());
                    // crossHairValue+103
                    graphPanel.setGraphView(crossHairValue, centerGraph);
                    // packetInfo.getRequestResponseInfo());
                    if (videoPlayer != null) {
                        // logger.info("enter getJPacketViewTable()");
                        videoPlayer.setMediaTime(graphPanel.getCrosshair());
                    // logger.info("leave getJPacketViewTable()");
                    }
                }
                this.packetInfo = packetInfo;
            }
        });
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) jPacketViewTable.getPopup();
        popupMenu.initialize();
    }
    return jPacketViewTable;
}
Also used : ListSelectionEvent(javax.swing.event.ListSelectionEvent) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) ListSelectionListener(javax.swing.event.ListSelectionListener)

Example 4 with DataTablePopupMenu

use of com.att.aro.ui.model.DataTablePopupMenu in project VideoOptimzer by attdevsupport.

the class RequestResponseDetailsPanel method getJRequestResponseTable.

/**
 * Initializes and returns the the DataTable that contains Http request and
 * response informations.
 */
public DataTable<HttpRequestResponseInfo> getJRequestResponseTable() {
    if (jRequestResponseTable == null) {
        jRequestResponseTable = new DataTable<HttpRequestResponseInfo>(jRequestResponseTableModel);
        jRequestResponseTable.setName(ResourceBundleHelper.getMessageString("diagnostics.request.response.view.tableName"));
        jRequestResponseTable.setAutoCreateRowSorter(true);
        jRequestResponseTable.setGridColor(Color.LIGHT_GRAY);
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) jRequestResponseTable.getPopup();
        popupMenu.initialize();
        jRequestResponseTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

            @Override
            public void valueChanged(ListSelectionEvent event) {
                // Enable view and save as buttons appropriately
                HttpRequestResponseInfo httpRRInfo = jRequestResponseTable.getSelectedItem();
                boolean validResponse = httpRRInfo != null && httpRRInfo.getContentLength() > 0 && httpRRInfo.getDirection() == HttpDirection.RESPONSE && httpRRInfo.getStatusCode() != 0;
                boolean isVideo = (validResponse) ? ((httpRRInfo != null && httpRRInfo.getContentType() != null) ? httpRRInfo.getContentType().contains("video/") : false) : false;
                boolean isApplicationZip = httpRRInfo != null && httpRRInfo.getContentType() != null && httpRRInfo.getContentType().contains("application/zip");
                boolean isContentTypeAvailable = httpRRInfo != null && httpRRInfo.getContentType() != null;
                getViewBtn().setEnabled(!isApplicationZip && !isVideo && validResponse && isContentTypeAvailable);
                getSaveBtn().setEnabled(!isApplicationZip && validResponse && isContentTypeAvailable);
            }
        });
        jRequestResponseTable.addMouseListener(new MouseAdapter() {

            public void mouseClicked(MouseEvent event) {
                if (event.getClickCount() == 2 && getViewBtn().isEnabled()) {
                    try {
                        viewContent(jRequestResponseTable.getSelectedItem());
                    } catch (Exception e) {
                        LOG.error("Failed to open the content in the view window with unexpected error", e);
                        new MessageDialogFactory().showPlainDialog(RequestResponseDetailsPanel.this.getTopLevelAncestor(), ResourceBundleHelper.getMessageString("view.requestresponsedetails.error.Message"), ResourceBundleHelper.getMessageString("view.requestresponsedetails.error.Title"));
                    }
                }
            }
        });
    }
    return jRequestResponseTable;
}
Also used : MouseEvent(java.awt.event.MouseEvent) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu) ListSelectionEvent(javax.swing.event.ListSelectionEvent) MouseAdapter(java.awt.event.MouseAdapter) MessageDialogFactory(com.att.aro.ui.commonui.MessageDialogFactory) IOException(java.io.IOException) ListSelectionListener(javax.swing.event.ListSelectionListener)

Example 5 with DataTablePopupMenu

use of com.att.aro.ui.model.DataTablePopupMenu in project VideoOptimzer by attdevsupport.

the class BpSecurityUnsecureSSLVersionTablePanel method getContentTable.

@SuppressWarnings("unchecked")
@Override
public DataTable<UnsecureSSLVersionEntry> getContentTable() {
    if (contentTable == null) {
        contentTable = new DataTable<UnsecureSSLVersionEntry>(tableModel);
        contentTable.setName(ResourceBundleHelper.getMessageString("security.unsecure.ssl.version.tableName"));
        contentTable.setAutoCreateRowSorter(true);
        contentTable.setGridColor(Color.LIGHT_GRAY);
        contentTable.setRowHeight(ROW_HEIGHT);
        contentTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) contentTable.getPopup();
        popupMenu.initialize();
    }
    return contentTable;
}
Also used : DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu) UnsecureSSLVersionEntry(com.att.aro.core.bestpractice.pojo.UnsecureSSLVersionEntry)

Aggregations

DataTablePopupMenu (com.att.aro.ui.model.DataTablePopupMenu)37 TableModel (javax.swing.table.TableModel)12 TableRowSorter (javax.swing.table.TableRowSorter)12 ListSelectionEvent (javax.swing.event.ListSelectionEvent)5 ListSelectionListener (javax.swing.event.ListSelectionListener)5 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)4 MinificationEntry (com.att.aro.core.bestpractice.pojo.MinificationEntry)2 CacheEntry (com.att.aro.core.packetanalysis.pojo.CacheEntry)2 Session (com.att.aro.core.packetanalysis.pojo.Session)2 MessageDialogFactory (com.att.aro.ui.commonui.MessageDialogFactory)2 SimultnsConnTableModel (com.att.aro.ui.model.bestpractice.SimultnsConnTableModel)2 AccessedDomainsTableModel (com.att.aro.ui.model.overview.AccessedDomainsTableModel)2 ExpandedDomainTableModel (com.att.aro.ui.model.overview.ExpandedDomainTableModel)2 MouseAdapter (java.awt.event.MouseAdapter)2 MouseEvent (java.awt.event.MouseEvent)2 IOException (java.io.IOException)2 AsyncCheckEntry (com.att.aro.core.bestpractice.pojo.AsyncCheckEntry)1 DisplayNoneInCSSEntry (com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSEntry)1 FileOrderEntry (com.att.aro.core.bestpractice.pojo.FileOrderEntry)1 ForwardSecrecyEntry (com.att.aro.core.bestpractice.pojo.ForwardSecrecyEntry)1