当前位置: 首页>>代码示例>>Java>>正文


Java TableColumn.setResizable方法代码示例

本文整理汇总了Java中javafx.scene.control.TableColumn.setResizable方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumn.setResizable方法的具体用法?Java TableColumn.setResizable怎么用?Java TableColumn.setResizable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.control.TableColumn的用法示例。


在下文中一共展示了TableColumn.setResizable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initTimeline

import javafx.scene.control.TableColumn; //导入方法依赖的package包/类
private void initTimeline(LocalDate start, LocalDate end) {
	this.timelineStart = start;
	this.timelineEnd = end;
	
	for(int m = start.getMonthValue(); m <= end.getMonthValue(); m++) {
		TableColumn<GanttTask,GanttBarPiece> monthCol = new TableColumn<GanttTask,GanttBarPiece>();
		Label month = new Label(Month.of(m).toString());
		monthCol.setGraphic(month);
		monthCol.setResizable(false);

		LocalDate tmp = LocalDate.of(start.getYear(), m, 1);
		LocalDate chartStart = start.compareTo(tmp) > 0 ? start : tmp;

		for(int d = chartStart.getDayOfMonth(); d <= chartStart.lengthOfMonth(); d++) {
			GanttDayColumn c = new GanttDayColumn(chartStart.getYear(), m, d);
			c.setPrefWidth(20);
			Label day = new Label(Integer.toString(d));
			c.setGraphic(day);
			monthCol.getColumns().add(c);
		}

		this.getColumns().add(monthCol);
	}
	// TODO make timeline right-left scrollable with wheel on windows 
}
 
开发者ID:vibridi,项目名称:qgu,代码行数:26,代码来源:TimelineView.java

示例2: createColumns

import javafx.scene.control.TableColumn; //导入方法依赖的package包/类
private void createColumns() {
    TableColumn<RequestEntry, String> eventTypeCol = new TableColumn("Type");
    eventTypeCol.setMinWidth(100);
    eventTypeCol.setCellValueFactory(new PropertyValueFactory<>("eventType"));
    eventTypeCol.setSortable(false);

    TableColumn<RequestEntry, String> eventNameCol = new TableColumn("Name");
    eventNameCol.setMinWidth(100);
    eventNameCol.setCellValueFactory(new PropertyValueFactory<>("eventName"));
    eventNameCol.setSortable(false);

    TableColumn<RequestEntry, String> eventDateTimeCol = new TableColumn("Time");
    eventDateTimeCol.setMinWidth(200);
    eventDateTimeCol.setCellValueFactory(new PropertyValueFactory<>("eventDateTime"));
    eventDateTimeCol.setSortable(false);

    TableColumn<RequestEntry, String> eventLocationCol = new TableColumn("Location");
    eventLocationCol.setMinWidth(100);
    eventLocationCol.setCellValueFactory(new PropertyValueFactory<>("eventLocation"));
    eventLocationCol.setSortable(false);

    TableColumn<RequestEntry, String> eventConductorCol = new TableColumn("Conductor");
    eventConductorCol.setMinWidth(100);
    eventConductorCol.setCellValueFactory(new PropertyValueFactory<>("eventConductor"));
    eventConductorCol.setSortable(false);

    TableColumn<RequestEntry, RequestTypeGUI> requestTypeCol = new TableColumn("Request");
    requestTypeCol.setCellFactory((param) -> new RequestRadioButtonCell<>(EnumSet.allOf(RequestTypeGUI.class)));
    requestTypeCol.setCellValueFactory(new PropertyValueFactory<>("requestType"));
    requestTypeCol.setSortable(false);

    TableColumn<RequestEntry, TextField> eventDescriptionCol = new TableColumn("Description");
    eventDescriptionCol.setMinWidth(300);
    eventDescriptionCol.setCellValueFactory(new PropertyValueFactory<RequestEntry, TextField>("requestDescription"));
    eventDescriptionCol.setResizable(false);
    eventDescriptionCol.setSortable(false);

    table.getColumns().addAll(eventTypeCol, eventNameCol, eventDateTimeCol, eventLocationCol, eventConductorCol, requestTypeCol, eventDescriptionCol);
}
 
开发者ID:ITB15-S4-GroupD,项目名称:Planchester,代码行数:40,代码来源:EditRequestsController.java

示例3: PlayerListTable

import javafx.scene.control.TableColumn; //导入方法依赖的package包/类
public PlayerListTable(ObservableList<PlayerView> players) {
	super();

	TableColumn<PlayerView, Integer> id = new TableColumn<>("ID");
	TableColumn<PlayerView, String> name = new TableColumn<>("Name");
	TableColumn<PlayerView, HBox> steamId = new TableColumn<>("Steam ID");
	TableColumn<PlayerView, String> vacBans = new TableColumn<>("VAC");
	TableColumn<PlayerView, HBox> actions = new TableColumn<>("Actions");

	id.setCellValueFactory(new PropertyValueFactory<>("id"));
	name.setCellValueFactory(new PropertyValueFactory<>("name"));
	steamId.setCellValueFactory(new PropertyValueFactory<>("steamPan"));
	vacBans.setCellValueFactory(new PropertyValueFactory<>("vacBans"));
	actions.setCellValueFactory(new PropertyValueFactory<>("actionPan"));
	
	
	id.setMaxWidth(25);
	id.setMinWidth(25);
	steamId.setMinWidth(220);
	steamId.setMaxWidth(220);
	vacBans.setMaxWidth(50);
	vacBans.setMinWidth(50);
	actions.setMinWidth(80);
	actions.setMaxWidth(80);
	
	id.setResizable(false);
	steamId.setResizable(false);
	actions.setResizable(false);
	vacBans.setResizable(false);
	
	this.getColumns().add(id);
	this.getColumns().add(name);
	this.getColumns().add(steamId);
	this.getColumns().add(vacBans);
	this.getColumns().add(actions);

	this.getColumns().forEach(c -> {
		c.setStyle(DEFAULT_STYLE);
	});
	
	this.players = players;
	
	this.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
	this.setPrefHeight(1000000);

	this.setItems(this.players);

}
 
开发者ID:ScreachFr,项目名称:titanium,代码行数:49,代码来源:PlayerListTable.java


注:本文中的javafx.scene.control.TableColumn.setResizable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。