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


Java Label.setPadding方法代码示例

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


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

示例1: PremisesAndConclusion

import javafx.scene.control.Label; //导入方法依赖的package包/类
public PremisesAndConclusion(String sPremises, String sConclusion) {
    premises = new TextField(sPremises);
    premises.textProperty().addListener((ov, oldValue, newValue) -> {
        parseAndStyle(premises, newValue);
    });
    parseAndStyle(premises, sPremises);
    premises.getStyleClass().add("myText");
    turnstile = new Label("⊢");
    turnstile.setPrefHeight(25);
    turnstile.setPrefWidth(26.0);
    turnstile.setPadding(new Insets(5,0,0,0));
    turnstile.setAlignment(Pos.CENTER);
    conclusion = new TextField(sConclusion);
    conclusion.textProperty().addListener((ov, oldValue, newValue) -> {
        parseAndStyle(conclusion, newValue);
    });
    parseAndStyle(conclusion, sConclusion);
    conclusion.getStyleClass().add("myText");
    consumeKeys(premises);
    consumeKeys(conclusion);
    this.getChildren().addAll(premises, turnstile, conclusion);
    setPrefs();
}
 
开发者ID:nonilole,项目名称:Conan,代码行数:24,代码来源:PremisesAndConclusion.java

示例2: ActionTextPane

import javafx.scene.control.Label; //导入方法依赖的package包/类
public ActionTextPane() {

        actionText = new Label("Test");
        graphic = new ImageView(new Image("assets/icons/editor_action_info_icon.png"));
        actionText.setGraphic(graphic);
        actionText.setTextFill(Utils.getDefaultTextColor());
        actionText.setAlignment(Pos.CENTER);
        actionText.setPadding(new Insets(0, 0, 0, 5));
        getChildren().add(actionText);
        setAlignment(Pos.CENTER);

        ft = new FadeTransition(Duration.millis(500), graphic);
        ft.setFromValue(1.0);
        ft.setToValue(0.0);
        ft.setAutoReverse(true);
        ft.setCycleCount(4);

    }
 
开发者ID:jdesive,项目名称:textmd,代码行数:19,代码来源:ActionTextPane.java

示例3: initProgressBarUI

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initProgressBarUI() {
    Label runLabel = new Label("Runs: ");
    runLabel.setMinWidth(Region.USE_PREF_SIZE);
    nRuns = new Text((int) progress + "/" + maxTestCount);

    Label errorLabel = new Label("Errors: ");
    errorLabel.setMinWidth(Region.USE_PREF_SIZE);
    errorLabel.setGraphic(FXUIUtils.getIcon("error"));
    errorLabel.setPadding(new Insets(0, 0, 0, 80));
    errorText = new Text(errors + "");

    Label failureLabel = new Label("Failures: ");
    failureLabel.setMinWidth(Region.USE_PREF_SIZE);
    failureLabel.setGraphic(FXUIUtils.getIcon("failure"));
    failureLabel.setPadding(new Insets(0, 0, 0, 80));
    failureText = new Text(failures + "");

    progressBarString.setAlignment(Pos.CENTER);
    progressBarString.setPadding(new Insets(5, 0, 5, 0));
    progressBarString.getChildren().addAll(runLabel, nRuns, errorLabel, errorText, failureLabel, failureText);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:22,代码来源:ProgressIndicatorBar.java

示例4: mkRoot

import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public Node mkRoot() {
	try {
		Parent node  = FXMLLoader.load(getClass().getResource("/ComplexScene.fxml"));
		node.setPickOnBounds(true);
		node.setMouseTransparent(true);
		WebView webview = (WebView) node.lookup("webview");
		if(webview != null){
			webview.getEngine().load("http://purecss3.net/doraemon/doraemon_css3.html");
		}

		GesturePane pane = new GesturePane(new SubScene(node, 500, 500));
		VBox.setVgrow(pane, Priority.ALWAYS);
		Label description = new Label("Zoom and scroll on the SubScene below, " +
				                              "observe that controls in JavaFX are vectors " +
				                              "and that lighting effects are respected" +
				                              "(different zoom alters light distance).");
		description.setWrapText(true);
		description.setPadding(new Insets(16));
		return new VBox(description, pane);

	} catch (IOException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:tom91136,项目名称:GestureFX,代码行数:26,代码来源:ArbitraryNodeSample.java

示例5: apply

import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public Node apply(int idx) {
    Val<String> formatted = paragraphs.map(n -> format(idx + 1, n));
    Label lineNo = new Label();
    lineNo.setCursor(Cursor.HAND);
    lineNo.setBackground(DEFAULT_BACKGROUND);
    lineNo.setPadding(DEFAULT_INSETS);
    lineNo.getStyleClass().add("lineno");
    lineNo.textProperty().bind(formatted.conditionOnShowing(lineNo));
    return lineNo;
}
 
开发者ID:kasirgalabs,项目名称:ETUmulator,代码行数:12,代码来源:LineNumberFunction.java

示例6: addRow

import javafx.scene.control.Label; //导入方法依赖的package包/类
/**
 * Add a new row to the grid, with a label and value. For each new row, an empty RowConstaints object is created.
 *
 * @param rowIndex Index to add row
 * @param label    Label node of row
 * @param value    Value node of row
 * @return RowConstraints object for the newly added row
 */
private RowConstraints addRow(int rowIndex, Label label, Node value) {
    // Set padding on the label
    label.setPadding(new Insets(vGap, 0, vGap, 0));

    // Add the new row
    paramsGrid.addRow(rowIndex, label, value);

    // Create the row constraints for it
    RowConstraints rowConstraints = new RowConstraints();
    paramsGrid.getRowConstraints().add(rowConstraints);

    return rowConstraints;
}
 
开发者ID:scify,项目名称:jedai-ui,代码行数:22,代码来源:ConfirmController.java

示例7: createBuildInformation

import javafx.scene.control.Label; //导入方法依赖的package包/类
private HBox createBuildInformation( ) {
    final HBox tileContent = new HBox( );
    tileContent.setAlignment( CENTER_LEFT );

    final Label tileTitle = new Label( );
    tileTitle.setFont( UIUtils.font( 50, FontWeight.BOLD ) );
    tileTitle.setTextFill( Color.WHITE );
    tileTitle.setPadding( new Insets( 5 ) );
    tileTitle.setWrapText( true );
    tileTitle.setEffect( UIUtils.shadowEffect( ) );
    tileTitle.textProperty( ).bind( _model.displayedNameProperty( ) );
    tileTitle.prefWidthProperty( ).bind( widthProperty( ) );
    tileTitle.prefHeightProperty( ).bind( heightProperty( ) );
    tileTitle.alignmentProperty( ).bind( createObjectBinding( ( ) -> _model.isLightMode( ) ? Pos.CENTER : CENTER_LEFT, _model.lightModeProperty( ) ) );
    tileTitle.textAlignmentProperty( ).bind( createObjectBinding( ( ) -> _model.isLightMode( ) ? CENTER : LEFT, _model.lightModeProperty( ) ) );
    HBox.setHgrow( tileTitle, Priority.SOMETIMES );
    tileContent.getChildren( ).add( tileTitle );

    final VBox contextPart = createContextPart( _model );
    contextPart.visibleProperty( ).bind( _model.lightModeProperty( ).not( ) );
    contextPart.prefWidthProperty( ).bind( createIntegerBinding( ( ) -> contextPart.isVisible( ) ? 145 : 0, contextPart.visibleProperty( ) ) );
    contextPart.prefHeightProperty( ).bind( heightProperty( ) );
    contextPart.setMinSize( USE_PREF_SIZE, USE_PREF_SIZE );
    contextPart.setMaxSize( USE_PREF_SIZE, USE_PREF_SIZE );
    tileContent.getChildren( ).add( contextPart );

    return tileContent;
}
 
开发者ID:u2032,项目名称:wall-t,代码行数:29,代码来源:TileView.java

示例8: refreshView

import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public void refreshView()
{
	lines.clear();
	StackShowList.getChildren().clear();
	ArrayList<String> names = new ArrayList<String>();
	int dataLength = 8;
	
		names.clear();

		names.add("first serverdoor");
		names.add("second serverdoor");
		names.add("third serverdoor");
		names.add("fourth serverdoor");
		names.add("first serverdoor");
		names.add("second serverdoor");
		names.add("third serverdoor");
		names.add("fourth serverdoor");
		names.add("first serverdoor");
		names.add("second serverdoor");
		names.add("third serverdoor");
		names.add("fourth serverdoor");
		names.add("first serverdoor");
		names.add("second serverdoor");
		names.add("third serverdoor");
		names.add("fourth serverdoor");
	
	
	for(int i = 0; i < dataLength; i++)
	{
		int counter = i;
		HBox entry = new HBox();
		Label lblServerDoor = new Label(names.get(i));
		lblServerDoor.setPadding(new Insets(15,0,0,250));
		lblServerDoor.setMinWidth(740);
		//AppButton btnMerge = new AppButton("Bearbeiten");
		AppButton btnModify = new AppButton("Bearbeiten");
		btnModify.setOnAction(e ->
		{
			ArrayList<String> list = new ArrayList<String>();
			list.add(names.get(counter));
			getFXController().getModel("dmomodifystackmodel").setDataList(list);				
			getFXController().showView("dmomodifystackview");
		}
		);
		

		entry.getChildren().addAll(lblServerDoor,btnModify);
		lines.add(entry);
	}
	
	for(HBox l : lines)
	{
		StackShowList.getChildren().add(l);
	}
	
}
 
开发者ID:CoffeeCodeSwitzerland,项目名称:Lernkartei_2017,代码行数:58,代码来源:DMOStackView.java

示例9: HeaderPanel

import javafx.scene.control.Label; //导入方法依赖的package包/类
public HeaderPanel(AppSession session) {
    this.session = session;
    content = new HBox(5);
    content.setPadding(new Insets(5));
    setCenter(content);
    textContent = new TextArea();
    textContent.setPrefRowCount(16);
    textContent.setVisible(false);
    setBottom(textContent);
    textContent.setManaged(false);
    textContent.setFont(App.getDefaultFont());
    textContent.focusedProperty().addListener((val, before, after) -> {
        if (!after) { // if we lost focus
            rebuildFeatureIfTextChanged();
        }
    });        
    MenuBar menuBar = new MenuBar();
    Menu fileMenu = new Menu("File");
    openFileMenuItem = new MenuItem("Open");
    fileMenu.getItems().addAll(openFileMenuItem);

    Menu importMenu = new Menu("Import");
    openImportMenuItem = new MenuItem("Open");
    importMenu.getItems().addAll(openImportMenuItem);

    menuBar.getMenus().addAll(fileMenu, importMenu);
    setTop(menuBar);

    if (session != null) {
        Label envLabel = new Label("karate.env");
        envLabel.setPadding(new Insets(5, 0, 0, 0));
        TextField envTextField = new TextField();
        envTextField.setText(session.getEnv().env);
        Button envButton = new Button("Reset");
        envButton.setOnAction(e -> session.resetAll(envTextField.getText()));
        Button runAllButton = new Button("Run ►►");
        runAllButton.setOnAction(e -> session.runAll());            
        Button showContentButton = new Button(getContentButtonText(false));
        initTextContent();
        showContentButton.setOnAction(e -> { 
            boolean visible = !textContent.isVisible();
            textContent.setVisible(visible);
            textContent.setManaged(visible);
            showContentButton.setText(getContentButtonText(visible));
        });
        content.getChildren().addAll(envLabel, envTextField, envButton, runAllButton, showContentButton);            
    }
}
 
开发者ID:intuit,项目名称:karate,代码行数:49,代码来源:HeaderPanel.java

示例10: initTabProcesses

import javafx.scene.control.Label; //导入方法依赖的package包/类
private Node initTabProcesses() {
	userProcessesList = FXCollections.observableArrayList();
	allProcessesList = FXCollections.observableArrayList();
       
	ProcessesUtil.getProcesses(allProcessesList, true);
       ProcessesUtil.getProcesses(userProcessesList, false);
       
       TableColumn pidCol = new TableColumn("PID");
       TableColumn nameCol = new TableColumn("Nome do processo");
	TableColumn userCol = new TableColumn("Usuário");
       TableColumn cpuCol = new TableColumn("CPU (%)");
	TableColumn memCol = new TableColumn("Memória (%)");
       
       pidCol.setCellValueFactory(
           new PropertyValueFactory<>("pid")
       );
	
	nameCol.setCellValueFactory(
           new PropertyValueFactory<>("readableName")
       );
	
	userCol.setCellValueFactory(
           new PropertyValueFactory<>("user")
       );
	
       cpuCol.setCellValueFactory(
           new PropertyValueFactory<>("CPU")
       );
	
	memCol.setCellValueFactory(
           new PropertyValueFactory<>("MEM")
       );
	
       viewProcesses = new TableView();
       viewProcesses.setEditable(false);
       viewProcesses.getColumns().addAll(pidCol, nameCol, userCol, cpuCol, memCol);
       viewProcesses.setItems(userProcessesList);
       
       viewProcesses.setOnMousePressed(mouseEventHandler);
       
       checkBoxAllProcesses = new CheckBox("Processos de todos usuários");
       checkBoxAllProcesses.setOnAction(actionEventHandler);
       
       inputFilter = new TextField();
	inputFilter.textProperty().addListener(this);
	
	Label labelFilter = new Label("Filtrar:");
	labelFilter.setPadding(new Insets(0, 10, 0, 0));
       
	HBox hBoxFilter = new HBox(labelFilter, inputFilter);
	hBoxFilter.setAlignment(Pos.BASELINE_RIGHT);
	HBox.setHgrow(hBoxFilter, Priority.ALWAYS); 
	
       HBox hBoxOptions = new HBox(checkBoxAllProcesses, hBoxFilter);
       hBoxOptions.setPrefWidth(prefWidth);
       hBoxOptions.setPadding(new Insets(10));
	
	return new VBox(viewProcesses, hBoxOptions);
}
 
开发者ID:dhiogoboza,项目名称:SystemMonitorJFX,代码行数:60,代码来源:MainStage.java

示例11: refreshView

import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public void refreshView()
{
	lines.clear();
	StackShowList.getChildren().clear();
	ArrayList<String> names = new ArrayList<String>();
	int dataLength = 8;
	
		names.clear();

		names.add("first Doorlocal");
		names.add("second Doorlocal");
		names.add("third Doorlocal");
		names.add("fourth Doorlocal");
		names.add("first Doorlocal");
		names.add("second Doorlocal");
		names.add("third Doorlocal");
		names.add("fourth Doorlocal");
		names.add("first Doorlocal");
		names.add("second Doorlocal");
		names.add("third Doorlocal");
		names.add("fourth Doorlocal");
		names.add("first Doorlocal");
		names.add("second Doorlocal");
		names.add("third Doorlocal");
		names.add("fourth Doorlocal");
	
	
	for(int i = 0; i < dataLength; i++)
	{
		int counter = i;
		HBox entry = new HBox();
		Label lblServerDoor = new Label(names.get(i));
		lblServerDoor.setPadding(new Insets(15,0,0,250));
		lblServerDoor.setMinWidth(590);
		AppButton btnMerge = new AppButton("Merge");
		AppButton btnInformation = new AppButton("i");
		btnInformation.setOnAction(e ->
		{
			ArrayList<String> list = new ArrayList<String>();
			list.add(names.get(counter));
			getFXController().getModel("doorstackinformationmodel").setDataList(list);				
			getFXController().showView("doorstackinformationview");
		}
		);
		

		entry.getChildren().addAll(lblServerDoor,btnInformation,btnMerge);
		lines.add(entry);
	}
	
	for(HBox l : lines)
	{
		StackShowList.getChildren().add(l);
	}
	
}
 
开发者ID:CoffeeCodeSwitzerland,项目名称:Lernkartei_2017,代码行数:58,代码来源:TeamworkServerDoorView.java

示例12: initializeLabel

import javafx.scene.control.Label; //导入方法依赖的package包/类
private void initializeLabel() {
    final Label label = (Label) lookup("#label");
    final JFXTextField textField = (JFXTextField) lookup("#textField");
    final Path shape = (Path) lookup("#shape");

    final Insets insets = new Insets(0,2,0,2);
    textField.setPadding(insets);
    label.setPadding(insets);

    final int padding = 0;

    label.layoutBoundsProperty().addListener((obs, oldBounds, newBounds) -> {
        double newWidth = Math.max(newBounds.getWidth(), 10);
        final double res = GRID_SIZE * 2 - (newWidth % (GRID_SIZE * 2));
        newWidth += res;

        textField.setMinWidth(newWidth);
        textField.setMaxWidth(newWidth);

        l2.setX(newWidth + padding);
        l3.setX(newWidth + padding);

        setMinWidth(newWidth + padding);
        setMaxWidth(newWidth + padding);

        textField.setMinHeight(TAG_HEIGHT);
        textField.setMaxHeight(TAG_HEIGHT);

        textField.focusedProperty().addListener((observable, oldFocused, newFocused) -> {
            if (newFocused) {
                shape.setTranslateY(2);
                textField.setTranslateY(2);
            }
        });

        if (getWidth() >= 1000) {
            setWidth(newWidth);
            setHeight(TAG_HEIGHT);
            shape.setTranslateY(-1);
            textField.setTranslateY(-1);
        }

        // Fixes the jumping of the shape when the text field is empty
        if (textField.getText().isEmpty()) {
            shape.setLayoutX(0);
        }
    });

    label.textProperty().bind(new When(textField.textProperty().isNotEmpty()).then(textField.textProperty()).otherwise(textField.promptTextProperty()));

}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:52,代码来源:TagPresentation.java

示例13: mkRoot

import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public Node mkRoot() {

	GesturePane pane = new GesturePane();

	WebView webview = new WebView();
	WebEngine engine = webview.getEngine();
	pane.addEventHandler(AffineEvent.CHANGED, e -> {
		String script = String.format(
				"document.getElementsByTagName('body')[0].style.transform = " +
						"'matrix(%s,0,0,%s,%s,%s)';",
				e.namedCurrent().scaleX(),
				e.namedCurrent().scaleY(),
				e.namedCurrent().translateX(),
				e.namedCurrent().translateY());
		engine.executeScript(script);
	});
	TextField bar = new TextField(INTERESTING_CSS);
	bar.setOnAction(e -> engine.load(bar.getText()));
	engine.load(bar.getText());
	engine.documentProperty().addListener((o, p, n) -> {
		if (n == null) return;
		pane.zoomTo(1, Point2D.ZERO);
		pane.setTarget(new Transformable() {
			@Override
			public double width() {
				return Double.valueOf(engine.executeScript("document.body.scrollWidth")
						                      .toString());
			}
			@Override
			public double height() {
				return Double.valueOf(engine.executeScript("document.body.scrollHeight")
						                      .toString());
			}
		});
	});

	Label description = new Label("GesturePane supports Transformable implementation. This " +
			                              "sample shows a WebView behind an empty GesturePane " +
			                              "listening for AffineEvents. The Affine matrix is " +
			                              "translated to CSS matrix and applied the the body " +
			                              "element. \nBe aware that all mouse events will be " +
			                              "consumed by the pane so you cannot click any " +
			                              "links.");
	description.setWrapText(true);
	description.setPadding(new Insets(16));
	StackPane glass = new StackPane(webview, pane);
	glass.setPrefSize(0, 0);
	VBox.setVgrow(glass, Priority.ALWAYS);
	return new VBox(description, bar, glass);

}
 
开发者ID:tom91136,项目名称:GestureFX,代码行数:53,代码来源:WebViewSample.java

示例14: MemberPane

import javafx.scene.control.Label; //导入方法依赖的package包/类
public MemberPane(Organization organization, EditOrganizationStage oms) {
	super();
	this.organization = organization;
	this.eos = oms;
	
	members = FXCollections.observableArrayList();
	forceUpdateMemberList();

	memberTable = new TableView<>(members);

	TableColumn<MemberView, String> nameCol = new TableColumn<>("Name");

	nameCol.setCellValueFactory(new PropertyValueFactory<>("username"));
	ColumnConstraints cc = new ColumnConstraints();
	cc.setPercentWidth(100);
	
	memberTable.getColumns().add(nameCol);
	
	memberTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
	
	buttonPane = new GridPane();
	buttonPane.setPadding(new Insets(10, 0, 0, 0));
	buttonPane.setHgap(5);

	addMember = new Button("Add Member...");
	removeMember = new Button("Remove selected");
	transfertOwnership = new Button("Transfert Ownership");

	buttonPane.addRow(0, addMember, removeMember, transfertOwnership);

	addMember.setOnAction(this::addMemberAction);
	removeMember.setOnAction(this::removeMemberAction);
	transfertOwnership.setOnAction(this::transferOwnershipAction);

	removeMember.setDisable(true);
	transfertOwnership.setDisable(true);
	
	Label title = new Label("Members :");
	title.setPadding(new Insets(0, 0, 10, 0));
	
	setTop(title);
	setCenter(memberTable);
	setBottom(buttonPane);

	memberTable.getSelectionModel().selectedItemProperty().addListener((obs, oldSelection, newSelection) -> {
		if (newSelection == null || newSelection.isYou()) {
			removeMember.setDisable(true);
			transfertOwnership.setDisable(true);
		} else {
			removeMember.setDisable(false);
			transfertOwnership.setDisable(false);
		}
	});
	
}
 
开发者ID:ScreachFr,项目名称:titanium,代码行数:56,代码来源:MemberPane.java

示例15: ServerPane

import javafx.scene.control.Label; //导入方法依赖的package包/类
public ServerPane(Organization organization, OrganizationManagerStage oms) {
	super();
	this.organization = organization;
	this.oms = oms;
	
	servers = FXCollections.observableArrayList();

	forceUpdateServerList();
	
	serverTable = new TableView<>(servers);
	serverTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
	
	TableColumn<ServerView, String> nameCol = new TableColumn<>("Name");
	TableColumn<ServerView, String> addressCol = new TableColumn<>("Address");

	nameCol.setCellValueFactory(new PropertyValueFactory<>("name"));
	addressCol.setCellValueFactory(new PropertyValueFactory<>("address"));

	serverTable.getColumns().add(nameCol);
	serverTable.getColumns().add(addressCol);
	
	buttonPane = new GridPane();
	buttonPane.setPadding(new Insets(10, 0, 0, 0));
	buttonPane.setHgap(5);
	
	addButton = new Button("Add Server...");
	editButton = new Button("Edit selected...");
	removeButton = new Button("Remove selected");
	
	addButton.setOnAction(this::addServerAction);
	editButton.setOnAction(this::editServerAction);
	removeButton.setOnAction(this::removeServerAction);
	
	editButton.setDisable(true);
	removeButton.setDisable(true);
	
	buttonPane.addRow(0, addButton, editButton, removeButton);
	
	Label title = new Label("Servers :");
	title.setPadding(new Insets(0, 0, 10, 0));
	
	setTop(title);
	setCenter(serverTable);
	setBottom(buttonPane);
	
	serverTable.getSelectionModel().selectedItemProperty().addListener((obs, oldSelection, newSelection) -> {
		if (newSelection == null) {
			editButton.setDisable(true);
			removeButton.setDisable(true);
		} else {
			editButton.setDisable(false);
			removeButton.setDisable(false);
		}
	});
	
}
 
开发者ID:ScreachFr,项目名称:titanium,代码行数:57,代码来源:ServerPane.java


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